Hi Shawn,
Thanks for your reply.

2008/10/17 Shawn <[EMAIL PROTECTED]>

>
> Another thing to note (and I could be wrong about this), I have never
> noticed a manytoone relationship creating any generated methods for
> the 'linked' object, only for the object in which manytoone is
> defined.

No - you're right - it doesn't usually - however, I thought perhaps the
composite id would generate something, so that its accessible to its parent
objects.



> However, onetomany adds methods to the 'child' table called
> getParentxxx()   Example:  theme.getParentBook() would return the book
> that 'owns' the given booktheme.  Which would sort of make the
> composition relationship for getBook() obsolete.

hmm yeah...


> >
> > You can avoid recursion issues by setting lazy="true" on your
> > manytoone composition relationships in the composite (as I did
> > above).
>
Ah... that might explain why I got getMemento loop errors earlier... I put
the lazy="true" in the book object rather than in the booktheme.


With this relationship, you can pull up an array of all of
> > the themes applied to a book with book.getThemeArray();  Since you
> > have a composite key, it appears you can have multiple themes applied
> > to a book.
> >
>
That's correct. (And a "star rating" with each theme)


>
> > Also, if you don't care about composition on your composite key, you
> > can also reference property instead instead of doing a composition
> > relationship.  ie.,
> >
> > <object name="booktheme" table="booktheme"
> > decorator="contentobjects.BaseBean">
> > <compositeid>
> >    <property name="bookID" column="bookID" />
> >   <property name="themeID" column="themeID" />
> > </compositeid>
> > <property name="StarRating" type="numeric"/>
> > </object>
> >
>
So this would do away with the need for the circular onetomany/manytoone
references, which is a benefit, but what am I losing by setting it up this
way?

Thanks again for your help.

Regards

Stephen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to