[OS-JIRA] Created: (CAY-331) DataMap ObjRelationship loses dbRelationshipPath on load

From: jira-norepl..bjectstyle.org
Date: Wed Jun 22 2005 - 13:00:40 EDT

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-332) ProcedureQuery must support all GenericSelectQuery features."

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-331

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-331
        Summary: DataMap ObjRelationship loses dbRelationshipPath on load
           Type: Bug

         Status: Assigned
       Priority: Critical

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.2 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Mike Kienenberger

        Created: Wed, 22 Jun 2005 12:59 PM
        Updated: Wed, 22 Jun 2005 12:59 PM

    Description:
    I'm now seeing ObjRelationships that are missing dbRelationshipPath for certain orderings of db-relationship in the DataMap during normal cayenne framework operation. (my unit test in this case).

    For example, the following order breaks the name="role" source="SEC_GROUP" relationship.

            <db-relationship name="role" source="SEC_GROUP" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>
            <db-relationship name="roleNetList" source="SEC_GROUP" target="SEC_ROLE_NET" toDependentPK="true" toMany="true">
                    <db-attribute-pair source="ID" target="PARENT_ROLE_ID"/>
            </db-relationship>
            <db-relationship name="secSystem" source="SEC_GROUP" target="SEC_SYSTEM" toMany="false">
                    <db-attribute-pair source="SYSTEM_ID" target="ID"/>
            </db-relationship>
            <db-relationship name="role" source="SEC_INDIVIDUAL" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>

    But this order makes it work again.

            <db-relationship name="roleNetList" source="SEC_GROUP" target="SEC_ROLE_NET" toDependentPK="true" toMany="true">
                    <db-attribute-pair source="ID" target="PARENT_ROLE_ID"/>
            </db-relationship>
            <db-relationship name="secSystem" source="SEC_GROUP" target="SEC_SYSTEM" toMany="false">
                    <db-attribute-pair source="SYSTEM_ID" target="ID"/>
            </db-relationship>
            <db-relationship name="role" source="SEC_INDIVIDUAL" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>
            <db-relationship name="role" source="SEC_GROUP" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>

            <obj-relationship name="role" source="SecGroup" target="SecRole" db-relationship-path="role"/>
            <db-relationship name="role" source="SEC_GROUP" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>

            <obj-relationship name="role" source="SecIndividual" target="SecRole" db-relationship-path="role"/>
            <db-relationship name="role" source="SEC_INDIVIDUAL" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>
            <db-relationship name="role" source="SEC_ROLE_NET" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="CHILD_ROLE_ID" target="ID"/>
            </db-relationship>

    Here's what the debugger shows when it's broken.

    this= ObjRelationship (id=127)
            dbRelationshipPath= null
            dbRelationships= ArrayList (id=128)
                    elementData= Object[10] (id=131)
                    modCount= 0
                    size= 0
            dbRelationshipsRef= Collections$UnmodifiableRandomAccessList (id=133)
            dbRelationshipsRefreshNeeded= false
            deleteRule= 0
            objName= "role"
            objParent= ObjEntity (id=135)
                    attributes= CayenneMap (id=137)
                    attributesMapRef= Collections$UnmodifiableSortedMap (id=138)
                    attributesRef= Collections$UnmodifiableCollection (id=139)
                    className= "com.gvea.admindb.entity.SecGroup"
                    clientClassName= "getRole"
                    clientSuperClassName= "SecRole"
                    dbEntityName= "SEC_GROUP"
                    lockType= 1
                    objName= "SecGroup"
                    objParent= DataMap (id=119)
                    qualifier= null
                    readOnly= false
                    relationships= CayenneMap (id=145)
                    relationshipsMapRef= Collections$UnmodifiableSortedMap (id=146)
                    relationshipsRef= Collections$UnmodifiableCollection (id=147)
                    superClassName= "com.gvea.cayenne.BaseDataObject"
                    superEntityName= null
            readOnly= false
            targetEntityName= "SecRole"
            toMany= false
            usedForLocking= false

    However, the almost-identical name="role" source="SEC_INDIVIDUAL" obj-relationship works in both orderings.

    this= ObjRelationship (id=29)
            dbRelationshipPath= "role"
            dbRelationships= ArrayList (id=50)
                    elementData= Object[10] (id=83)
                    modCount= 1
                    size= 1
            dbRelationshipsRef= Collections$UnmodifiableRandomAccessList (id=64)
            dbRelationshipsRefreshNeeded= false
            deleteRule= 0
            objName= "role"
            objParent= ObjEntity (id=71)
                    attributes= CayenneMap (id=86)
                    attributesMapRef= Collections$UnmodifiableSortedMap (id=95)
                    attributesRef= Collections$UnmodifiableCollection (id=98)
                    className= "com.gvea.admindb.entity.SecIndividual"
                    clientClassName= "getRole"
                    clientSuperClassName= "SecRole"
                    dbEntityName= "SEC_INDIVIDUAL"
                    lockType= 1
                    objName= "SecIndividual"
                    objParent= DataMap (id=104)
                    qualifier= null
                    readOnly= false
                    relationships= CayenneMap (id=110)
                    relationshipsMapRef= Collections$UnmodifiableSortedMap (id=111)
                    relationshipsRef= Collections$UnmodifiableCollection (id=112)
                    superClassName= "com.gvea.cayenne.BaseDataObject"
                    superEntityName= null
            readOnly= false
            targetEntityName= "SecRole"
            toMany= false
            usedForLocking= false

    It's possible that this has something to do with multiple obj-relationships and db-relationships with the same name in the same DataMap.

    The problem relationship:

            <obj-relationship name="role" source="SecGroup" target="SecRole" db-relationship-path="role"/>
            <db-relationship name="role" source="SEC_GROUP" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>

    Other relationships:

            <obj-relationship name="role" source="SecIndividual" target="SecRole" db-relationship-path="role"/>
            <db-relationship name="role" source="SEC_INDIVIDUAL" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="ID" target="ID"/>
            </db-relationship>
            <db-relationship name="role" source="SEC_ROLE_NET" target="SEC_ROLE" toMany="false">
                    <db-attribute-pair source="CHILD_ROLE_ID" target="ID"/>
            </db-relationship>

    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-321 is possibly a subset of this issue.

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Wed Jun 22 2005 - 13:00:40 EDT