I *think* I understand now, but there's one problem: a compositeid can't contain a onetomany relationship. Only manytoone, parentonetomany, or property.
And I seem to be missing a table. I had originally designed this with 6 tables: carts, items, products, options, item_options, and product_options. Carts, products, and options are "root" data in that they don't have any explicit links to other tables. Items are the line items within a cart, so each row explicitly links to a cart and a product. The compositeid would be the cartID, the productID, and the linenumber (to allow the same product with different options: see below). item_options and product_options are the m2m linkages to allow a product or line item to have many options. They both contain the optionID, but item_options needs to link to the full composite ID of an item, not the simple productID property that product_options can link to. Without being able to use a onetomany link in a compositeid, I'm afraid I'll have to generate a UUID for each line item, which seems to me to be overkill (although I suppose I could use an auto- incremented integer to save compute cycles). Also, as a point of clarification, should there be foreign keys set up in the database itself, or is using the compositing of Transfer sufficient? Ken Cummins On Nov 11, 4:51 pm, "Mark Mandel" <[EMAIL PROTECTED]> wrote: > Don't know why this isn't going to the google group. > > Mark > > > > On Wed, Nov 12, 2008 at 9:50 AM, Mark Mandel <[EMAIL PROTECTED]> wrote: > > Right - So, something like (very pseudo code): > > > <object name="cart> > > <id name="uuid" /> > > <onetomany name="LineItems"> > > <link to="LineItem" /> > > </onetomany> > > </object> > > > <object name="Product> > > <id name="uuid" /> > > </object> > > > <object name="ProductOptions> > > <id name="uuid" /> > > </object> > > > <object name="LineItem> > > <compositeid> > > <parentonetomany class="cart" /> > > <onetomany name="Product" /> > > <onetomany name="ProductOption" /> > > </compositeid> > > <onetomany name="Product"> > > <link to="Product" /> > > </onetomany> > > <onetomany name="ProductOption"> > > <link to="ProductOption" /> > > </onetomany> > > </object> > > > That's pretty much it. > > > You should have a look at the sample applications for more examples of > > compositions, and > >http://docs.transfer-orm.com/wiki/Managing_Relationships_and_Composit... > > > Mark > > > On Wed, Nov 12, 2008 at 9:37 AM, <[EMAIL PROTECTED]> wrote: > >> Alright... > > >> Cart has a generated UUID. > >> Product has a generated UUID. > >> ProductOptions has a generated UUID. > > >> LineItem has a composite primary ID of CartID and ProductID, and a column > >> for the ProductOptionID. > > >> When I try to set up the M2M definition to ProductOptions, how to I > >> reference the parent link? I can't reference *both* portions of the primary > >> key, as there can only be 2 <link /> children of the <manytomany /> object. > >> I've sidestepped the problem (for now) by using a UUID for the LineItem > >> table as well, which gives me only two references for my M2M definition. > > >> On Nov 11, 2008 4:29pm, Mark Mandel <[EMAIL PROTECTED]> wrote: > > > -- > > E: [EMAIL PROTECTED] > > W:www.compoundtheory.com > > -- > E: [EMAIL PROTECTED] > W:www.compoundtheory.com --~--~---------~--~----~------------~-------~--~----~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---