Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>finally found a way to do it. So I replaced with and created one for Abstract class too. Not sure if it is a bug with EclipseLink. And another issue is using generated-value strategy "SEQUENCE" (may be others) is not generating sequences properly. </p> <p>My orm looks like below </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" version="2.3"&gt; &lt;persistence-unit-metadata&gt; &lt;exclude-default-mappings /&gt; &lt;/persistence-unit-metadata&gt; &lt;entity class="ABC"&gt; &lt;table name="" /&gt; &lt;attributes&gt; &lt;id .......&gt; &lt;/id&gt; &lt;basic name="ts" attribute-type="long" /&gt; &lt;one-to-one name="field-referring-to-abstract-class" &gt; &lt;join-column name="ABSTRACT_ID"/&gt; &lt;cascade&gt; &lt;cascade-all /&gt; &lt;/cascade&gt; &lt;/one-to-one&gt; &lt;/attributes&gt; &lt;/entity&gt; &lt;entity class="ABSTRACT-CLASS" &gt; &lt;table name="ABSTRACT-TABLE"/&gt; &lt;inheritance strategy="TABLE_PER_CLASS" /&gt; &lt;attributes&gt; &lt;id name="ABSTRACT_ID" attribute-type="String" &gt; &lt;column name="ABSTRACT_ID" /&gt; &lt;/id&gt; &lt;/attributes&gt; &lt;/entity&gt; &lt;entity class="SUB-CLASS1-TO-ABSTRACT" access="FIELD"&gt; &lt;table name="SUBCLASS1"/&gt; &lt;attributes&gt; &lt;basic name="name" attribute-type="String" /&gt; &lt;basic name="age" attribute-type="int" /&gt; &lt;/attributes&gt; &lt;/entity&gt; &lt;entity class="SUB-CLASS2-TO-ABSTRACT" access="FIELD"&gt; &lt;table name="SUBCLASS2"/&gt; &lt;attributes&gt; &lt;basic name="city" attribute-type="String" /&gt; &lt;basic name="zipcode" attribute-type="int" /&gt; &lt;/attributes&gt; &lt;/entity&gt; &lt;/entity-mappings&gt; </code></pre> <p>so, this is storing to appropriate tables as we as reading provided PK in subclasses I provide holds uniqueness. </p> <p>hope this helps thanks Gopi</p>
 

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