<?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 Persistance Impl Errors in case of TableMapper</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=107037915" />
  <subtitle>Service Builder Persistance Impl Errors in case of TableMapper</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=107037915</id>
  <updated>2026-08-02T08:00:10Z</updated>
  <dc:date>2026-08-02T08:00:10Z</dc:date>
  <entry>
    <title>RE: Service Builder Persistance Impl Errors in case of TableMapper</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110224433" />
    <author>
      <name>Jorge Diaz</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110224433</id>
    <updated>2018-06-20T05:49:40Z</updated>
    <published>2018-06-20T05:49:40Z</published>
    <summary type="html">&lt;p&gt;Since 7.0 version, companyId column was added to all Liferay tables
  in order to allow configuring data partitioning at database level by
  instances (companyId).&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So perhaps there is some servicebuilder code that takes for granted
  every entity has companyId field.&lt;/p&gt;</summary>
    <dc:creator>Jorge Diaz</dc:creator>
    <dc:date>2018-06-20T05:49:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Builder Persistance Impl Errors in case of TableMapper</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110222816" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110222816</id>
    <updated>2018-06-20T01:16:24Z</updated>
    <published>2018-06-20T01:16:24Z</published>
    <summary type="html">&lt;p&gt;Just to add some advice here, based on my own experience. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;When the Service Builder &amp;quot;template&amp;quot; service.xml file is
  generated there is a section with companyId, groupId, userId,
  userName, createDate, modifiedDate. I would recommend that you always
  leave those fields and complete them when creating records. You may
  not need them now, but they provide a certain degree of future
  proofing in the even that you need to reuse this same entity across
  multiple sites or portal instances -- it allows you to properly scope
  data for different properties in the same table. &lt;/p&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2018-06-20T01:16:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Builder Persistance Impl Errors in case of TableMapper</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110215627" />
    <author>
      <name>Aliasgar Pratapgarhwala</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110215627</id>
    <updated>2018-06-19T10:20:11Z</updated>
    <published>2018-06-19T10:20:11Z</published>
    <summary type="html">&lt;p&gt;Yes it works, Thank you for your response.&lt;/p&gt;</summary>
    <dc:creator>Aliasgar Pratapgarhwala</dc:creator>
    <dc:date>2018-06-19T10:20:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Builder Persistance Impl Errors in case of TableMapper</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109186719" />
    <author>
      <name>Jia Terry</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109186719</id>
    <updated>2018-05-31T02:53:40Z</updated>
    <published>2018-05-31T02:53:40Z</published>
    <summary type="html">hey Aliasgar,&lt;br /&gt;can you try to add the column&lt;br /&gt;&amp;lt;column name=&amp;#34;companyId&amp;#34; type=&amp;#34;long&amp;#34; /&amp;gt;&lt;br /&gt;into your both two entities?</summary>
    <dc:creator>Jia Terry</dc:creator>
    <dc:date>2018-05-31T02:53:40Z</dc:date>
  </entry>
  <entry>
    <title>Service Builder Persistance Impl Errors in case of TableMapper</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107037914" />
    <author>
      <name>Aliasgar Pratapgarhwala</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=107037914</id>
    <updated>2018-04-23T07:30:03Z</updated>
    <published>2018-04-23T07:30:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Greetings,&lt;br&gt;&lt;br&gt;We are working on migration of service builder code from 6.2 to DXP/7.0 using IDE.&lt;br&gt;&lt;br&gt;Now, in case of Liferay 6.2 we have used &lt;strong&gt;"mapping-table"&lt;/strong&gt; feature for few entities. When trying to use similar entities in Liferay 7 IDE, we are getting errors in *PersistanceImpl of that entity. &lt;br&gt;&lt;br&gt;&lt;strong&gt;Below is my build.gradle:-&lt;/strong&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
	compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "+"
	compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "+"
	compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "+"
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "+"
	compileOnly project(":modules:sample-service:sample-service-api")
}

buildService {
	apiDir = "../sample-service-api/src/main/java"
}

group = "sample.service"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;strong&gt;Below is my entity definition:-&lt;/strong&gt;&lt;br&gt;   &lt;pre&gt;&lt;code&gt;&amp;lt;entity name="Employee" remote-service="false" local-service="true"&amp;gt;
        &amp;lt;column name="employeeId" type="long" primary="true"&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name="name" type="String"&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name="deptId" type="Collection" entity="Department" mapping-table="Employee_department" /&amp;gt;
    &amp;lt;/entity&amp;gt;
    &amp;lt;entity name="Department" remote-service="false" local-service="true"&amp;gt;
        &amp;lt;column name="deptId" type="long" primary="true"&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name="name" type="String"&amp;gt;&amp;lt;/column&amp;gt;
        &amp;lt;column name="employeeId" type="Collection" entity="Employee" mapping-table="Employee_department" /&amp;gt;
    &amp;lt;/entity&amp;gt;&lt;/code&gt;&lt;/pre&gt; &lt;br&gt;&lt;br&gt;&lt;strong&gt;Below is the error in DepartmentPersistanceImpl (Similar case for EmployeePersistanceImpl):-&lt;/strong&gt;&lt;br&gt;&lt;em&gt;The method getCompanyId() is undefined for the type Department&lt;/em&gt;&lt;br&gt;&lt;br&gt;Please find Attached screenshot of the same.&lt;br&gt;&lt;br&gt;Appreciate your response in this matter. &lt;br&gt;Thanks and Regards,&lt;br&gt;Aliasgar Pratapgarhwala&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Aliasgar Pratapgarhwala</dc:creator>
    <dc:date>2018-04-23T07:30:03Z</dc:date>
  </entry>
</feed>
