<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Service Builder relating two custom entities</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118773778" />
  <subtitle>Service Builder relating two custom entities</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118773778</id>
  <updated>2026-04-03T21:27:45Z</updated>
  <dc:date>2026-04-03T21:27:45Z</dc:date>
  <entry>
    <title>RE: Service Builder relating two custom entities</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120611760" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120611760</id>
    <updated>2021-02-12T21:07:12Z</updated>
    <published>2021-02-12T21:07:12Z</published>
    <summary type="html">&lt;p&gt;I 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:&lt;/p&gt;
&lt;p&gt;public Location getLocation() {&lt;/p&gt;
&lt;p&gt;  return locationLocalService.getLocation(this.locationId);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2021-02-12T21:07:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Builder relating two custom entities</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120611638" />
    <author>
      <name>Victor Manea</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120611638</id>
    <updated>2021-02-12T17:02:17Z</updated>
    <published>2021-02-12T17:02:17Z</published>
    <summary type="html">&lt;p&gt;Hi, did you find a solution to this ? I have the same situation.&lt;/p&gt;</summary>
    <dc:creator>Victor Manea</dc:creator>
    <dc:date>2021-02-12T17:02:17Z</dc:date>
  </entry>
  <entry>
    <title>Service Builder relating two custom entities</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118773777" />
    <author>
      <name>marvin ros</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118773777</id>
    <updated>2020-03-20T07:08:50Z</updated>
    <published>2020-03-20T07:08:50Z</published>
    <summary type="html">Hello together,&lt;br /&gt;&lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;I have tried to use the mapping-table attribute and the reference attribute:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;column name=&amp;#34;locations&amp;#34; type=&amp;#34;Collection&amp;#34; entity=&amp;#34;my.custom.second.portlet.model.Location&amp;#34; mapping-table=&amp;#34;JobOffer_Location&amp;#34; /&amp;gt;&lt;br /&gt;&amp;lt;reference package-path=&amp;#34;my.custom.second.portlet&amp;#34; entity=&amp;#34;Location&amp;#34; /&amp;gt;&lt;/blockquote&gt;when I run build service I am getting this error:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Caused by: java.io.IOException: Unable to open resource my/custom/second/portlet/model/service.xml in class loader  &lt;a href="http://sun.misc.Launcher$AppClassLoader@70dea4e"&gt;sun.misc.Launcher$AppClassLoader@70dea4e&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;So my question is: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do I relate a custom Entity to another custom Entity in different service.xml files? Is this even possible?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Thank you in advance!</summary>
    <dc:creator>marvin ros</dc:creator>
    <dc:date>2020-03-20T07:08:50Z</dc:date>
  </entry>
</feed>
