<?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>Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=97681901" />
  <subtitle>Liferay 7 Service Builder, Issue with Primary Key with Date type.</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=97681901</id>
  <updated>2026-04-04T12:29:47Z</updated>
  <dc:date>2026-04-04T12:29:47Z</dc:date>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117679736" />
    <author>
      <name>Dave Truong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117679736</id>
    <updated>2019-11-06T18:13:49Z</updated>
    <published>2019-11-06T18:13:49Z</published>
    <summary type="html">It was killed because we discovered that in different scenarios (different OS/JVM/D&lt;img alt="emoticon" src="@theme_images_path@/emoticons/cool.gif" &gt; combinations because of precision issues you would not get the same results.  We recommend converting it to a long timestamp instead.</summary>
    <dc:creator>Dave Truong</dc:creator>
    <dc:date>2019-11-06T18:13:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117666754" />
    <author>
      <name>Kevin Neibarger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117666754</id>
    <updated>2019-11-05T14:57:43Z</updated>
    <published>2019-11-05T14:57:43Z</published>
    <summary type="html">After some configuration changes and setting the &lt;strong&gt;com.liferay.gradle.plugins&lt;/strong&gt; to &lt;strong&gt;3.12.74&lt;/strong&gt; I&amp;#39;m getting the following error when trying to build the service classes&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;service.api.dir=${basedir}/../portal-kernel/src&lt;/strong&gt;&lt;strong&gt;service.auto.import.default.references=true&lt;/strong&gt;&lt;strong&gt;Exception in thread &amp;#34;main&amp;#34; service.auto.namespace.tables=false&lt;/strong&gt;&lt;strong&gt;service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil&lt;/strong&gt;&lt;strong&gt;service.build.number=1&lt;/strong&gt;&lt;strong&gt;service.build.number.increment=true&lt;/strong&gt;&lt;strong&gt;service.hbm.file=${basedir}/src/META-INF/portal-hbm.xml&lt;/strong&gt;&lt;strong&gt;service.impl.dir=${basedir}/src&lt;/strong&gt;&lt;strong&gt;service.input.file=${service.file}&lt;/strong&gt;&lt;strong&gt;service.model.hints.configs=classpath*:META-INF/portal-model-hints.xml,META-INF/portal-model-hints.xml,classpath*:META-INF/ext-model-hints.xml,classpath*:META-INF/portlet-model-hints.xml&lt;/strong&gt;&lt;strong&gt;service.model.hints.file=${basedir}/src/META-INF/portal-model-hints.xml&lt;/strong&gt;&lt;strong&gt;service.osgi.module=false&lt;/strong&gt;&lt;strong&gt;service.plugin.name=&lt;/strong&gt;&lt;strong&gt;service.props.util=&lt;/strong&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;strong&gt;com.liferay.portal.util.PropsUtil&lt;/strong&gt;&lt;strong&gt;java.lang.IllegalArgumentException: Primary key dateAdded of entity InterventionAgingReportEngine must be an int, long, or String&lt;/strong&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;service.read.only.prefixes=fetch,get,has,is,load,reindex,search&lt;/strong&gt;&lt;strong&gt;service.resource.actions.configs=META-INF/resource-actions/default.xml,resource-actions/default.xml&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;Why is java.util.Date no longer supported in Liferay 7.1?? It was supported in 6.2 as I had no issues with it... This makes little sense to downgrade support in newer versions... Anyone know what java.util.Date is not supported?</summary>
    <dc:creator>Kevin Neibarger</dc:creator>
    <dc:date>2019-11-05T14:57:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117666439" />
    <author>
      <name>Kevin Neibarger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117666439</id>
    <updated>2019-11-05T14:23:33Z</updated>
    <published>2019-11-05T14:23:33Z</published>
    <summary type="html">I did find a correct configuration for the Gradle file, but the problem that remains seems to be an issue with java.util.Date when the build service builds the service and api classes. For example, I have an entity with a composite key&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;&amp;lt;column name=&amp;#34;upi&amp;#34; db-name=&amp;#34;UPI&amp;#34; type=&amp;#34;int&amp;#34; primary=&amp;#34;true&amp;#34; /&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;&amp;lt;column name=&amp;#34;category&amp;#34; type=&amp;#34;String&amp;#34; primary=&amp;#34;true&amp;#34; /&amp;gt;&lt;/strong&gt;&lt;strong&gt;&amp;lt;column name=&amp;#34;subCategory&amp;#34; type=&amp;#34;String&amp;#34; primary=&amp;#34;true&amp;#34; /&amp;gt;&lt;/strong&gt;&lt;strong&gt;&amp;lt;column name=&amp;#34;detail&amp;#34; type=&amp;#34;String&amp;#34; primary=&amp;#34;true&amp;#34; /&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;&amp;lt;column name=&amp;#34;dateAdded&amp;#34; type=&amp;#34;Date&amp;#34; primary=&amp;#34;true&amp;#34; /&amp;gt;&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;It appears that &lt;strong&gt;dateAdded&lt;/strong&gt; is being treated as a long when the xxxPK class is being called and that xxxPK class is passing a long where a java.util.Date should be. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;interventionAgingReportCarePlanPK = new InterventionAgingReportCarePlanPK(upi,&lt;/strong&gt;&lt;strong&gt;practice, category, subCategory, detail, dateAdded);&lt;/strong&gt;&lt;br /&gt;So the above gives a compile error.  Seems to be a bug with the service builder, as it&amp;#39;s not correctly reading a java.util.Date for some reason. Has this implementation changed so we now can&amp;#39;t use a java.util.Date in a composite key now?? </summary>
    <dc:creator>Kevin Neibarger</dc:creator>
    <dc:date>2019-11-05T14:23:33Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117665106" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117665106</id>
    <updated>2019-11-05T09:17:32Z</updated>
    <published>2019-11-05T09:17:32Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I just ran into something like this the other day. Turned out the default build.gradle for the -api module was missing some new dependencies:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
   compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
   compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
   compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
   compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
   compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
   compileOnly group: "com.liferay", name: "com.liferay.petra.string"
}&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Once I added those last two dependencies in, all was fine. I'm using the target platform support, so I don't have to list the versions explicitly.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-11-05T09:17:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117661922" />
    <author>
      <name>Kevin Neibarger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117661922</id>
    <updated>2019-11-04T21:18:45Z</updated>
    <published>2019-11-04T21:18:45Z</published>
    <summary type="html">&lt;blockquote&gt;I realize this is an old post, but I&amp;#39;ve downloaded the most current liferay 7.2 bundle and any service builder entity that has a composite PK generates the appropriate classes but those classes don&amp;#39;t compile. Below is my gradle file&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;buildscript {dependencies {classpath group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.gradle.plugins&amp;#34;, version: &amp;#34;3.9.10&amp;#34;}&lt;br /&gt;repositories {maven {url &amp;#34;https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public&amp;#34;}}}&lt;br /&gt;subprojects {apply plugin: &amp;#34;com.liferay.plugin&amp;#34;&lt;br /&gt;repositories {mavenLocal()&lt;br /&gt;maven {url &amp;#34;https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public&amp;#34;}}}&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I get compile errors that the constructor&amp;#39;s don&amp;#39;t exist. Am I using the incorrect version of the com.liferay.gradle.plugins? &lt;br /&gt;&lt;/blockquote&gt;</summary>
    <dc:creator>Kevin Neibarger</dc:creator>
    <dc:date>2019-11-04T21:18:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697987" />
    <author>
      <name>Steve Barski</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697987</id>
    <updated>2017-10-28T12:56:01Z</updated>
    <published>2017-10-28T12:56:01Z</published>
    <summary type="html">I have workspace 1.5.0, and tried the suggestion but still not working. Any other ideas? I would like a work around instead of filing a bug report.&lt;br /&gt;&lt;br /&gt;Thanks!</summary>
    <dc:creator>Steve Barski</dc:creator>
    <dc:date>2017-10-28T12:56:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697981" />
    <author>
      <name>Steve Barski</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697981</id>
    <updated>2017-10-28T12:52:39Z</updated>
    <published>2017-10-28T12:52:39Z</published>
    <summary type="html">Correct. The import for java.util.Date statement is not generated in the service classes, which this seems like a bug in Liferay 7. Unless someone has an idea for a work around. Any ideas?</summary>
    <dc:creator>Steve Barski</dc:creator>
    <dc:date>2017-10-28T12:52:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697400" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97697400</id>
    <updated>2017-10-28T09:13:30Z</updated>
    <published>2017-10-28T09:13:30Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Two ideas:&lt;br&gt;&lt;br&gt;1) Workspace version:&lt;br&gt;Look into settings.gradle and check your "workspace version". It should be at least 1.5&lt;br&gt;&lt;pre&gt;&lt;code&gt;buildscript {
	dependencies {
		classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.5.0"
		classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
	}

	repositories {
		maven {
			url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
		}
	}
}

apply plugin: "net.saliman.properties"
apply plugin: "com.liferay.workspace"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;If it is below  "1.5.0", you could try to replace the settings.gradle with above file.&lt;br&gt;&lt;br&gt;2) Add Date to the Impl class:&lt;br&gt;FeedbackImpl.java:&lt;br&gt;&lt;pre&gt;&lt;code&gt;public Date getDummy() { return null;}&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Service builder also looks into the implementation and maybe you can "inject" the import "from above".&lt;br&gt;&lt;br&gt;Btw.: If you have this issue with workspace 1.5.0, you should file a bug.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2017-10-28T09:13:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97687427" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97687427</id>
    <updated>2017-10-27T23:47:43Z</updated>
    <published>2017-10-27T23:47:43Z</published>
    <summary type="html">Looks like it is not handling the import correctly for java.util.Date, that&amp;#39;s why you get symbol errors on the class.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2017-10-27T23:47:43Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7 Service Builder, Issue with Primary Key with Date type.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97681900" />
    <author>
      <name>Steve Barski</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97681900</id>
    <updated>2017-10-27T19:05:15Z</updated>
    <published>2017-10-27T19:05:15Z</published>
    <summary type="html">Has anyone run into issue with service builder and using a Date type in as a part of composite in a Finder method. I have the below service XML and when building the service seems that Liferay 7  is not including the Date type as part of the class import, which causes the build to fail. I do not have an issue building this in Liferay 6.2. I appreciate an insights.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Steve&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE service-builder PUBLIC &amp;#34;-//Liferay//DTD Service Builder 7.0.0//EN&amp;#34; &amp;#34;http://www.liferay.com/dtd/liferay-service-builder_7_0_0.dtd&amp;#34;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;service-builder package-path=&amp;#34;com.xgjtiv.vp.feedback&amp;#34;&amp;gt;&lt;br /&gt;  &amp;lt;author&amp;gt;GSB&amp;lt;/author&amp;gt;&lt;br /&gt;  &amp;lt;namespace&amp;gt;Feedback&amp;lt;/namespace&amp;gt;&lt;br /&gt;  &amp;lt;entity name=&amp;#34;Feedback&amp;#34; table=&amp;#34;vp_feedback&amp;#34; local-service=&amp;#34;true&amp;#34; remote-service=&amp;#34;false&amp;#34;&amp;gt;&lt;br /&gt;    &amp;lt;!-- PK Fields --&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;organization&amp;#34; db-name=&amp;#34;org&amp;#34; primary=&amp;#34;true&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;userEmailAddress&amp;#34; db-name=&amp;#34;user_email&amp;#34; primary=&amp;#34;true&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;submitDate&amp;#34; db-name=&amp;#34;submit_date&amp;#34; primary=&amp;#34;true&amp;#34; type=&amp;#34;Date&amp;#34; /&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;!-- Other Fields --&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;userFirstName&amp;#34; db-name=&amp;#34;user_first_name&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;userLastName&amp;#34; db-name=&amp;#34;user_last_name&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;topic&amp;#34; db-name=&amp;#34;topic&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;feedback&amp;#34; db-name=&amp;#34;feedback&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;column name=&amp;#34;userAgent&amp;#34; db-name=&amp;#34;user_agent&amp;#34; type=&amp;#34;String&amp;#34; /&amp;gt;&lt;br /&gt;    &lt;br /&gt;     &amp;lt;!-- Finders --&amp;gt;&lt;br /&gt;    &amp;lt;finder name=&amp;#34;vp_feedback_pk&amp;#34; db-index=&amp;#34;true&amp;#34; return-type=&amp;#34;Collection&amp;#34;&amp;gt;&lt;br /&gt;      &amp;lt;finder-column name=&amp;#34;organization&amp;#34; /&amp;gt;&lt;br /&gt;      &amp;lt;finder-column name=&amp;#34;userEmailAddress&amp;#34; /&amp;gt;&lt;br /&gt;      &amp;lt;finder-column name=&amp;#34;submitDate&amp;#34; /&amp;gt;&lt;br /&gt;    &amp;lt;/finder&amp;gt;&lt;br /&gt;  &amp;lt;/entity&amp;gt;&lt;br /&gt;&amp;lt;/service-builder&amp;gt;&lt;br /&gt;&lt;br /&gt;error from the build:&lt;br /&gt;    [javac] C:\SP14_Code_Convert_v3\liferay-plugins-sdk-6.2-ee-sp14\portlets\vantage-point-feedback-portlet\docroot\WEB-INF\service\com\unisys\vantagepoint\feedback\model\Feedback.java:74: error: cannot find symbol&lt;br /&gt;    [javac] 	public static final Accessor&amp;lt;Feedback, Date&amp;gt; SUBMIT_DATE_ACCESSOR = new Accessor&amp;lt;Feedback, Date&amp;gt;() {&lt;br /&gt;    [javac] 	                                       ^&lt;br /&gt;    [javac]   symbol:   class Date&lt;br /&gt;    [javac]   location: interface Feedback&lt;br /&gt;    [javac] C:\SP14_Code_Convert_v3\liferay-plugins-sdk-6.2-ee-sp14\portlets\vantage-point-feedback-portlet\docroot\WEB-INF\service\com\unisys\vantagepoint\feedback\model\Feedback.java:74: error: cannot find symbol&lt;br /&gt;    [javac] 	public static final Accessor&amp;lt;Feedback, Date&amp;gt; SUBMIT_DATE_ACCESSOR = new Accessor&amp;lt;Feedback, Date&amp;gt;() {&lt;br /&gt;    [javac] 	                                                                                           ^&lt;br /&gt;    [javac]   symbol:   class Date&lt;br /&gt;    [javac]   location: interface Feedback&lt;br /&gt;    [javac] C:\SP14_Code_Convert_v3\liferay-plugins-sdk-6.2-ee-sp14\portlets\vantage-point-feedback-portlet\docroot\WEB-INF\service\com\unisys\vantagepoint\feedback\model\Feedback.java:76: error: cannot find symbol&lt;br /&gt;    [javac] 			public Date get(Feedback feedback) {&lt;br /&gt;    [javac] 			       ^&lt;br /&gt;    [javac]   symbol: class Date&lt;br /&gt;    [javac] C:\SP14_Code_Convert_v3\liferay-plugins-sdk-6.2-ee-sp14\portlets\vantage-point-feedback-portlet\docroot\WEB-INF\service\com\unisys\vantagepoint\feedback\model\Feedback.java:81: error: cannot find symbol&lt;br /&gt;    [javac] 			public Class&amp;lt;Date&amp;gt; getAttributeClass() {&lt;br /&gt;    [javac] 			             ^&lt;br /&gt;    [javac]   symbol: class Date&lt;br /&gt;    [javac] C:\SP14_Code_Convert_v3\liferay-plugins-sdk-6.2-ee-sp14\portlets\vantage-point-feedback-portlet\docroot\WEB-INF\service\com\unisys\vantagepoint\feedback\model\Feedback.java:82: error: cannot find symbol&lt;br /&gt;    [javac] 				return Date.class;&lt;br /&gt;    [javac] 				       ^&lt;br /&gt;    [javac]   symbol: class Date&lt;br /&gt;    [javac] Note: Some input files use unchecked or unsafe operations.&lt;br /&gt;    [javac] Note: Recompile with -Xlint:unchecked for details.&lt;br /&gt;    [javac] 5 errors</summary>
    <dc:creator>Steve Barski</dc:creator>
    <dc:date>2017-10-27T19:05:15Z</dc:date>
  </entry>
</feed>
