From: Brad B. <br...@bb...> - 2003-08-06 02:19:04
|
On Tuesday, August 5, 2003, at 08:31 PM, Bruno Trevisan wrote: > Hi There > >> >>> At 14:18 2003-07-24 -0400, Brad Bollenbach wrote: >>>>> Well, if there's going to be composite keys, that might as well be >>>>> generalized to all the columns (i.e., any attribute could be a >>>> composite >>>>> of several columns). >>>> >>>> What's the use case for this? > > So I think a have a situation where some could need this: > (note, this is existent database, system under development has to > integrate to it, so bad database layout is not a way out here. Badly > designed databases are out there and we must work with some of them) :( > > > products_table > +---+-----------------------+ > |id | description | family_id | subfamily_id | > +---+----------------+-----------+--------------+ > | 1| Foobar gum | 10 | 5| > | 1| Foobar lolipops| 10 | 6| > | 1| Foobar socks | 20 | 5| > > family_table > +---+-----------------------+ > |id | description | > +---+-----------------------+ > | 10| Candies | > | 20| Underwear | > > subfamily_table > +---+-----------+---------------+ > |id | family_id | description | > +---+-----------+---------------+ > | 5| 10| chewing gum | > | 5| 20| socks | > | 6| 10| lolipops | > > I need to retrieve subfamily description for my products. It is > possible > to manually retrieve it, but the idea is just state to SQLObject that > id > and family_id are primary keys for the subfamily table and that the > subfamily are linked to the products through those keys. Having > SQLObject retrieving the subfamily object when I retrieve a product > using those definitions would be great. Once again, that's what properties are for (see example I posted early on in this thread). :) -- Brad Bollenbach BBnet.ca |