Hi,
i would like to create a many-to-many relation between to entities but i can't find any information or example on how to do this. For example, let's say i have the following entities: <entity entity-name="A"> <field name="ida" type="id"/> <prim-key field="ida"/> </entity> <entity entity-name="B"> <field name="idb" type="id"/> <prim-key field="idb"/> </entity> How can i model a many-to-many relationship between these two entities ? Thanks in advance, Hugo |
Hello Hugo,
You just create an associate class ABAssoc that contains only A pk and B pk Nicolas Le 30/06/2010 17:37, Hugo Palma a écrit : > Hi, > i would like to create a many-to-many relation between to entities but i > can't find any information or example on how to do this. > > For example, let's say i have the following entities: > > <entity entity-name="A"> > <field name="ida" type="id"/> > <prim-key field="ida"/> > </entity> > > <entity entity-name="B"> > <field name="idb" type="id"/> > <prim-key field="idb"/> > </entity> > > How can i model a many-to-many relationship between these two entities ? > > Thanks in advance, > Hugo > > -- Nicolas MALIN Consultant Tél : 06.17.66.40.06 Site projet : http://www.neogia.org/ ------- Société LibrenBerry Tél : 02.48.02.56.12 Site : http://www.librenberry.net/ |
I think what Nicolas is trying to say is that in a physical model for a relational database there is no such thing as a many-to-many relationship between tables, so you need a "join" table to implement that conceptual model. In OFBiz you'll see a lot of these sorts of entities with a suffix of "Assoc" or "Appl" or sometimes other or no suffix, but you can find examples with those suffixes. -David On Jun 30, 2010, at 10:11 AM, Nicolas Malin wrote: > Hello Hugo, > > You just create an associate class ABAssoc that contains only A pk and B pk > > Nicolas > > Le 30/06/2010 17:37, Hugo Palma a écrit : >> Hi, >> i would like to create a many-to-many relation between to entities but i >> can't find any information or example on how to do this. >> >> For example, let's say i have the following entities: >> >> <entity entity-name="A"> >> <field name="ida" type="id"/> >> <prim-key field="ida"/> >> </entity> >> >> <entity entity-name="B"> >> <field name="idb" type="id"/> >> <prim-key field="idb"/> >> </entity> >> >> How can i model a many-to-many relationship between these two entities ? >> >> Thanks in advance, >> Hugo >> >> > > > -- > Nicolas MALIN > Consultant > Tél : 06.17.66.40.06 > Site projet : http://www.neogia.org/ > ------- > Société LibrenBerry > Tél : 02.48.02.56.12 > Site : http://www.librenberry.net/ > |
Thanks Nicolas and David. Got it working.
Cheers, Hugo On Wed, Jun 30, 2010 at 17:24, David E Jones <[hidden email]> wrote: > > I think what Nicolas is trying to say is that in a physical model for a > relational database there is no such thing as a many-to-many relationship > between tables, so you need a "join" table to implement that conceptual > model. > > In OFBiz you'll see a lot of these sorts of entities with a suffix of > "Assoc" or "Appl" or sometimes other or no suffix, but you can find examples > with those suffixes. > > -David > > > On Jun 30, 2010, at 10:11 AM, Nicolas Malin wrote: > > > Hello Hugo, > > > > You just create an associate class ABAssoc that contains only A pk and B > pk > > > > Nicolas > > > > Le 30/06/2010 17:37, Hugo Palma a écrit : > >> Hi, > >> i would like to create a many-to-many relation between to entities but i > >> can't find any information or example on how to do this. > >> > >> For example, let's say i have the following entities: > >> > >> <entity entity-name="A"> > >> <field name="ida" type="id"/> > >> <prim-key field="ida"/> > >> </entity> > >> > >> <entity entity-name="B"> > >> <field name="idb" type="id"/> > >> <prim-key field="idb"/> > >> </entity> > >> > >> How can i model a many-to-many relationship between these two entities ? > >> > >> Thanks in advance, > >> Hugo > >> > >> > > > > > > -- > > Nicolas MALIN > > Consultant > > Tél : 06.17.66.40.06 > > Site projet : http://www.neogia.org/ > > ------- > > Société LibrenBerry > > Tél : 02.48.02.56.12 > > Site : http://www.librenberry.net/ > > > > |
Free forum by Nabble | Edit this page |