Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7011313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:06:40+00:00 2026-05-27T22:06:40+00:00

I have a self referential table that I am mapping with kodo jdo 4

  • 0

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:

<openjpa-1.1.1-SNAPSHOT-r422266:965591 fatal user error> 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)

the table is:

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)
);

the class is :

public class Branch implements MenuPart, Serializable
{
private Branch parent;
    private Set<Branch> branches = new HashSet<Branch> ();
    private String id;
    private Set<Leaf> leafs = new HashSet<Leaf> ();
    private long ordering;
    private String title;
    //methods removed.
}

the package.jdo file is:

    <class name="Branch" objectid-class="BranchId" table="SCHEMA.BRANCH">
        <version strategy="none"/>
        <field name="parent" table="SCHEMA.BRANCH">
                <column name="SCHEMA.BRANCH.PARENTID" target="ID" />
        </field>
        <field name="branches" table="SCHEMA.BRANCH" >
            <collection element-type="Branch"/>
            <join>  
                <column name="SCHEMA.BRANCH.PARENTID" target="ID" />
            </join>
        </field>
        <field name="id" column="ID" primary-key="true"/>
        <field name="leafs" table="SCHEMA.LEAF">
            <collection element-type="Leaf"/>
              <join>  
                <column name="ID" target="BRANCHID" />
      </join>
        </field>
        <field name="ordering" column="ORDERING"/>
        <field name="title" column="TITLE"/>
    </class>

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:06:40+00:00Added an answer on May 27, 2026 at 10:06 pm

    here is what finally worked

        <class name="Branch" objectid-class="BranchId" table="EBIGP.BRANCH">
            <version strategy="none"/>
            <field name="parent">
                <column name="EBIGP.BRANCH.PARENTID" target="ID" />
            </field>
            <field name="branches" mapped-by="parent" />
            <field name="id" column="ID" primary-key="true"/>
            <field name="leafs" default-fetch-group="true">
                <collection element-type="Leaf"/>
                <element column="BRANCHID"/>
            </field>
            <field name="ordering" column="ORDERING"/>
            <field name="title" column="TITLE"/>
        </class>
    

    Apparently all it needed was a mapped-by=”parent” attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's what I have: I have a table called Area that is self referential.
I have a data table that contains a one-to-many self referential relationship: Plant {
I have a self referencing table named categories that has a parentcategoryid column that
I have a self referencing table in Oracle 9i, and a view that gets
I have a self referential table, which has ID, ParentID (nullable). So, the table
I have a class Node with a self referential mapping 'children' (backref 'parent') representing
I have a self-referential MySQL table with a recursive parent_id: CREATE TABLE `recursive` (
If I have a self-referential Topic class and I want to recursively loop through
I have a self-referencing table with an Id, CategoryName, and ParentId. It's a typical
I'm having issues with downcasting in JAXB with classes that are self-referential. My setup:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.