Mark, If I would do that then when IDContacts is an organization, there are no corresponding representatives, because there's only a lookup on column IDPerson in Representatives. You see, that's why I need both onetomany's. Any IDContact can be either in Representatives.IDPerson or Representatives.IDOrganization
Since there are no fields IDPerson and IDOrganization any longer in a Representative object, so neither the corresponding methods, I actually also need 2 manytoones on Representatives to link back to Contacts to get further details. But there are some tricky loops here. All seems fine as long as all relations are set lazy. Well, going to take some sleep first - 2:30 in the morning here. Thanks again, Richard On Oct 10, 1:40 am, "Mark Mandel" <[EMAIL PROTECTED]> wrote: > Ooooh, I see the problem... and... erk, yeah, not your fault. > > There is a limitation on onetomany that means it can only be connected > to an object once... basically, because of a bad design decision I > made. :P > > The way I would set this up (and it should also be easier to work with): > > <object name="Contacts" table="contacts"> > <id name="IDContacts" column="IDContact" type="string" /> > <property name="enumType" type="string" column="enumType" /> > <property name="name" type="string" column="name" /> > <property name="address" type="string" column="address" /> > > <onetomany name="repr1"> > <link to="Representatives" column="IDPerson" /> > <collection type="array"/> > </onetomany> > </object> > > <object name="Representatives" table="representatives"> > <id name="IDRepresentatives" column="IDRepresentative" type="string" /> > <property name="job" type="string" column="job" /> > > <manytoone name="Organization> > <link to="Contacts" column="IDOrganization" /> > </manytoone> > </object> > > That way you have an array of Contacts, that link to Organisations.. > and also means you shouldn't get a rediculously large object as well. > > Sorry about that, but that should get you going. > > Mark --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
