Composite key vs Serrogate for SeqId

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Composite key vs Serrogate for SeqId

cjhowe
I've been continuing my playing around with some of
the pentaho project stuff and there's a limitation
with their query structure that doesn't support
composite foreign keys.  While there are several
places in OFBiz where the composite key holds meaning
with the data model, I was reluctant to see the
benefit of using a composite key for entities like
OrderItem (orderId, orderItemSeqId) over simply having
an orderItemId  as a single field primary key.  Does
the sequence (01,02,03, etc) hold any meaning that
needs to be maintained?
Reply | Threaded
Open this post in threaded view
|

Re: Composite key vs Serrogate for SeqId

davidnwelton
> Does
> the sequence (01,02,03, etc) hold any meaning that
> needs to be maintained?

BTW, having sequential numbers like this might not be such a hot idea,
as your competition could use that to get an idea of how many orders
you do in a day/week/month/etc...

--
David N. Welton
 - http://www.dedasys.com/davidw/

Linux, Open Source Consulting
 - http://www.dedasys.com/
Reply | Threaded
Open this post in threaded view
|

Re: Composite key vs Serrogate for SeqId

cjhowe
That's somewhat true for the orderId (you'll likely
lose several sequential orderIds when you grab 10 in
sequence but only use 3 before the cache expires).
However, I'm referring to the orderItemSeqId, the line
items of the order.

--- David Welton <[hidden email]> wrote:

> > Does
> > the sequence (01,02,03, etc) hold any meaning that
> > needs to be maintained?
>
> BTW, having sequential numbers like this might not
> be such a hot idea,
> as your competition could use that to get an idea of
> how many orders
> you do in a day/week/month/etc...
>
> --
> David N. Welton
>  - http://www.dedasys.com/davidw/
>
> Linux, Open Source Consulting
>  - http://www.dedasys.com/
>