Hmmmm... ASCII art might be tough. Maybe this will help:
<object name="items" table="cart_items">
<compositeid>
<manytoone name="cart" />
<manytoone name="products" />
</compositeid>
<manytoone name="cart">
<link to="cart.cart" column="cart_id" />
</manytoone>
<manytoone name="products">
<link to="products.products"
column="products_id" />
</manytoone>
<manytomany name="options"
table="cart_item_has_options">
<link to="cart.items" column="cart_id"
/>
<link to="cart.items"
column="product_id" />
<link to="products.options"
column="options_id" />
<collection type="array">
<order property="options_id"
order="asc" />
</collection>
</manytomany>
</object>
As you can see, there is a compositeid for cart.items, each component
of which is a manytoone link to different tables. But when I try to
set up the manytomany link to products.options, I don't have a key to
link back to the cart.items. Does that make more sense?
On Tue, Nov 11, 2008 at 3:41 PM, Mark Mandel <[EMAIL PROTECTED]> wrote:
>
> Ken - can you write this out in some more details (ASCII art maybe), I
> having trouble following what you are trying to do.
>
> Mark
>
> On Wed, Nov 12, 2008 at 5:57 AM, Ken Cummins <[EMAIL PROTECTED]> wrote:
> >
> > I may be doing this all wrong, since this is my first serious
> > application. So I welcome comments and critiques...
> >
> > I'm building the ubiquitous shopping cart. I'm building it because it
> > needs some special functionality that's not easily hacked onto
> > existing packages.
> >
> > Anyway, I figured I'd start with a simple cart. So I have a Cart
> > table with an ID (Transfer-managed UUID) and some other minor data.
> > This has a OneToMany relationship with a Line Items table.
> >
> > The Line Items table uses a compositeid of the Cart ID and the line
> > number.
> >
> > The Line Items table has a ManyToOne relationship to the Products
> > table, which is no probem.
> >
> > The kicker is that I want a ManyToMany relationship with the Product
> > Options table, but since the compositeid isn't treated as a single
> > property, I can't really get the link properly set up.
> >
> > Am I doing something phenomenally wrong, or am I trying to get too
> > elegant by avoiding a superfluous datum for a Line Item ID?
> >
> > Ken
> > >
> >
>
>
>
> --
> 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---