Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenJPA Enhance -- The identity field defined in the {0} Embeddable is not supported
    primarykey
    data
    text
    <p>I am using the following JPA code with MySQL DB and OpenJPA 2.2.2:</p> <pre><code>@MappedSuperclass public abstract class IdentifiableEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; // getters, setters, etc. } @Entity public class User extends IdentifiableEntity { private String name; // getters, setters, etc. } </code></pre> <p>I get this message when doing <code>User user = new User();</code> in JSE environment:</p> <blockquote> <p>ERROR [main] openjpa.Enhance - The identity field defined in the IdentifiableEntity Embeddable is not supported.</p> </blockquote> <p>I tried running with the OpenJPA dynamically loaded class enhancer on Oracle 1.6 JDK. The code seems to be executing correctly in spite of the message.</p> <p>Why am I getting this message? Is it benign?</p> <p>Here are the contents of <code>persistence.xml</code>:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt; &lt;persistence-unit name="persistenceUnit"&gt; &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt; &lt;properties&gt; &lt;property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3306/playground?useUnicode=true&amp;amp;characterEncoding=UTF-8"/&gt; &lt;property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/&gt; &lt;property name="openjpa.ConnectionUserName" value="guest"/&gt; &lt;property name="openjpa.ConnectionPassword" value="guest"/&gt; &lt;!-- Classes should be enhanced at build-time for production. --&gt; &lt;property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/&gt; &lt;property name="openjpa.DynamicEnhancementAgent" value="true"/&gt; &lt;!-- Enable logging --&gt; &lt;property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE" /&gt; &lt;property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true" /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload