Message Boards
Service Builder relating two custom entities
marvin ros, modified 4 Years ago.
Service Builder relating two custom entities
Junior Member Posts: 35 Join Date: 5/9/19 Recent Posts
Hello together,
well I looked for a solution for a while now but I can not find one.I have two completely different custom service Builder modules and I want to use a entity relation between them.
I have tried to use the mapping-table attribute and the reference attribute:
So I dont want to put them in one service Builder module to keep it as modular as possible because the Location service Builder module is needed from a bunch of other portlets as well.
So my question is:
How do I relate a custom Entity to another custom Entity in different service.xml files? Is this even possible?
Thank you in advance!
well I looked for a solution for a while now but I can not find one.I have two completely different custom service Builder modules and I want to use a entity relation between them.
I have tried to use the mapping-table attribute and the reference attribute:
<column name="locations" type="Collection" entity="my.custom.second.portlet.model.Location" mapping-table="JobOffer_Location" />when I run build service I am getting this error:
<reference package-path="my.custom.second.portlet" entity="Location" />
Caused by: java.io.IOException: Unable to open resource my/custom/second/portlet/model/service.xml in class loader sun.misc.Launcher$AppClassLoader@70dea4e
So I dont want to put them in one service Builder module to keep it as modular as possible because the Location service Builder module is needed from a bunch of other portlets as well.
So my question is:
How do I relate a custom Entity to another custom Entity in different service.xml files? Is this even possible?
Thank you in advance!
Victor Manea, modified 3 Years ago.
RE: Service Builder relating two custom entities
New Member Posts: 11 Join Date: 10/23/20 Recent PostsHi, did you find a solution to this ? I have the same situation.
Christoph Rabel, modified 3 Years ago.
RE: Service Builder relating two custom entities
Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent PostsI am not really a service builder expert, so the only idea I have here is to just store the id of the location and add a getLocation() method to the ModelImpl and fetching them from there, e.g. something like:
public Location getLocation() {
return locationLocalService.getLocation(this.locationId);
}