Forums de discussion

Query regarding setting up relationship through service.xml

thumbnail
Arunjyoti Banik, modifié il y a 9 années.

Query regarding setting up relationship through service.xml

Junior Member Publications: 74 Date d'inscription: 26/08/14 Publications récentes
I found this code piece in the default service.xml provided by Liferay.

<column name="userGroups" type="Collection" entity="UserGroup" mapping-table="Users_UserGroups" />

It is about how user_ table is mapped with usergroup and user_usergroup tables.

I saw in both the tables the primarykey is userGroupId. (userId columns are also there but it is not primary key in usergroup table).

But I cannot figure out what does this column name userGroups signify. And where can I find that column exactly??

And what is the use of <refernce-package-path>??? Do I have to specify it mandatorily while creating a service builder for relation with existing table??
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Query regarding setting up relationship through service.xml

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
The name attribute is what the java member will be in the containing object. So whatever the java entity is called, it would end up with a List<UserGroup> userGroups; declaration.

Reference package path is necessary if you are using an entity defined somewhere else, i.e. a Liferay entity in your own service definition. You do not need it for any entities defined within the service.xml file itself, just external entities.