Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
asile elisa
many to many relationship
April 5, 2010 8:43 AM

asile elisa

Rank: Regular Member

Posts: 126

Join Date: February 17, 2010

Recent Posts

hi everyone

how do I declare a many to many relationship in service.xml
I have these tables:


thanks in advance
Robson SARAIVA Ximenes
RE: many to many relationship
October 29, 2012 7:17 AM

Robson SARAIVA Ximenes

Rank: New Member

Posts: 10

Join Date: June 18, 2012

Recent Posts

Need this answer to..
Harish Kumar
RE: many to many relationship
October 30, 2012 12:52 AM

Harish Kumar

Rank: Expert

Posts: 474

Join Date: July 31, 2010

Recent Posts


Following is the description to implement many to many relationship in service.xml

 2If the entity and mapping-table attributes are specified and mapping-key is not, then the Service Builder will assume you are specifying a many to many relationship.
 4For example:
 6<column name="roles" type="Collection" entity="Role" mapping-table="Groups_Roles" />
 8The above column specifies that there will be a getter called pojo.getRoles() that will return a collection. It will use a mapping table called Groups_Roles to give a many to many relationship between groups and roles.
10If you are creating a mapping table for an entity defined in another service.xml, you need to specify the full package path.

Extracted from service.xml dtd.