Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the syntax of package.jdo file for a self referential table
    text
    copied!<p>I have a self referential table that I am mapping with kodo jdo 4 (supplied from weblogic server 10.3.4.) The code I have will get through the enhancer, but when I try to use it I get the error:</p> <pre><code>&lt;openjpa-1.1.1-SNAPSHOT-r422266:965591 fatal user error&gt; kodo.jdo.FatalUserException: Missing table name for field "com.[...].jdo.Branch.branches". This field cannot reside in the owning class table. at org.apache.openjpa.jdbc.meta.FieldMapping.mapJoin(FieldMapping.java:529) </code></pre> <p>the table is:</p> <pre><code>CREATE TABLE branch ( id VARCHAR2(10) NOT NULL, parentId VARCHAR2(10) NOT NULL, [other fields deleted ...] CONSTRAINT branch_pk PRIMARY KEY(id), CONSTRAINT branch_fk_parent FOREIGN KEY(parentId) REFERENCES branch(id) ); </code></pre> <p>the class is :</p> <pre><code>public class Branch implements MenuPart, Serializable { private Branch parent; private Set&lt;Branch&gt; branches = new HashSet&lt;Branch&gt; (); private String id; private Set&lt;Leaf&gt; leafs = new HashSet&lt;Leaf&gt; (); private long ordering; private String title; //methods removed. } </code></pre> <p>the package.jdo file is:</p> <pre><code> &lt;class name="Branch" objectid-class="BranchId" table="SCHEMA.BRANCH"&gt; &lt;version strategy="none"/&gt; &lt;field name="parent" table="SCHEMA.BRANCH"&gt; &lt;column name="SCHEMA.BRANCH.PARENTID" target="ID" /&gt; &lt;/field&gt; &lt;field name="branches" table="SCHEMA.BRANCH" &gt; &lt;collection element-type="Branch"/&gt; &lt;join&gt; &lt;column name="SCHEMA.BRANCH.PARENTID" target="ID" /&gt; &lt;/join&gt; &lt;/field&gt; &lt;field name="id" column="ID" primary-key="true"/&gt; &lt;field name="leafs" table="SCHEMA.LEAF"&gt; &lt;collection element-type="Leaf"/&gt; &lt;join&gt; &lt;column name="ID" target="BRANCHID" /&gt; &lt;/join&gt; &lt;/field&gt; &lt;field name="ordering" column="ORDERING"/&gt; &lt;field name="title" column="TITLE"/&gt; &lt;/class&gt; </code></pre> <p>I have gotten the functionality to work in kodo jdo 3.4 but now the syntax is different and the friendly manual isn't that helpful that I can find.</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