Borrow your eyes for a minute?

From: Jonathan Carlson (Jonathan.Carlso..atun.com)
Date: Tue Dec 20 2005 - 14:02:59 EST

  • Next message: Mike Kienenberger: "Re: Borrow your eyes for a minute?"

    I've put off asking this for a week or so now because I'm sure this has
    to be something I messed up (it was working fine), but I'm giving up and
    asking if somebody might be able to see what I can't.

    I have a very basic PERSON table with a to-one FATHER_ID relationship
    that loops back on the PERSON table. When I do a getFather() on any
    Person instance, I get this error:

     org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1.2 April 28
    2005] More than 1 object found for ObjectId
    wicket.contrib.rad.example.cayenne.data.Person (temp): . Fetch matched
    16 objects.
     
    I have exactly 16 rows in that table, so it looks like Cayenne is just
    not using the ID as a qualifier.
            
    Here are the appropriate parts in my Map.xml:

    <db-entity name="PERSON">
      <db-attribute name="FATHER_ID" type="INTEGER"/>
      <db-attribute name="FIRST_NAME" type="VARCHAR" length="50"/>
      <db-attribute name="ID" type="INTEGER" isPrimaryKey="true"
    isMandatory="true"/>
      <db-attribute name="LAST_NAME" type="VARCHAR" length="50"/>
      <db-attribute name="MOTHER_ID" type="INTEGER"/>
      <db-attribute name="SEX" type="CHAR" length="1"/>
    </db-entity>

    <db-relationship name="FATHER_CHILD_REL" source="PERSON"
    target="PERSON" toMany="true">
      <db-attribute-pair source="ID" target="FATHER_ID"/>
    </db-relationship>
    <db-relationship name="FATHER_REL" source="PERSON" target="PERSON"
    toMany="false">
      <db-attribute-pair source="FATHER_ID" target="ID"/>
    </db-relationship>

    <obj-relationship name="father" source="Person" target="Person"
    db-relationship-path="FATHER_REL"/>
    <obj-relationship name="fatherOf" source="Person" target="Person"
    db-relationship-path="FATHER_CHILD_REL"/>

    Any ideas of what I can do to further debug this issue? I'm rather
    stuck until I get this resolved.

    Thanks!

    Jonathan

    ______________________________________________________________________
    This email and any files transmitted with it are confidential and
    intended solely for the use of the individual or entity to whom they
    are addressed. If you have received this email in error please notify
    the system manager.

    Katun Corporation -- www.katun.com
    _____________________________________________________________________



    This archive was generated by hypermail 2.0.0 : Tue Dec 20 2005 - 14:03:36 EST