Hello.

I am on thin ice here... Trying to test meaningful and compound primary keys in the CocoaCayenne ROP client. See the model-info at the bottom of this message.

Adding keywords works ok. Changing them are comitted to the database, but the returned diff are very strange. This is the returned diff if I change the keyword "hopp3" to "hopp4" for the user "halset".

CAYNodeIdChangeOperation {nodeId = CAYObjectId {Keyword; objectIdKeys = {KEYWORD = hopp3; USERNAME = halset; }; singleKey = (null); singleValue = <null>; tempKey = (null); replacementIdMap = {KEYWORD = hopp4; }}; newNodeId = CAYObjectId {Keyword; objectIdKeys = <null>; singleKey = KEYWORD; singleValue = hopp4; tempKey = (null); replacementIdMap = <null>}}

The original object id is ok . Notice the compound primary key. However, the new object id is very strange as it uses the singleKey/ singleValue field. I would expect "objectIdKeys" to contain the new values and singleKey/singleValue only to be used for tables with a single primary key.

One more thing: What is "replacementIdMap" and do I need to use it for anything on the ROP client?

 - Tore.

        <db-entity name="T_KEYWORD">
<db-attribute name="KEYWORD" type="VARCHAR" isPrimaryKey="true" isMandatory="true" length="20"/> <db-attribute name="USERNAME" type="VARCHAR" isPrimaryKey="true" isMandatory="true" length="20"/>
        </db-entity>
        <db-entity name="T_USER">
                <db-attribute name="FULL_NAME" type="VARCHAR" length="40"/>
<db-attribute name="USERNAME" type="VARCHAR" isPrimaryKey="true" isMandatory="true" length="20"/>
        </db-entity>

<obj-entity name="Keyword" className="no.thc.tracker.data.Keyword" clientClassName="no.thc.tracker.client.data.Keyword" dbEntityName="T_KEYWORD"> <obj-attribute name="keyword" type="java.lang.String" db-attribute- path="KEYWORD"/>
        </obj-entity>
<obj-entity name="User" className="no.thc.tracker.data.User" clientClassName="no.thc.tracker.client.data.User" dbEntityName="T_USER"> <obj-attribute name="fullName" type="java.lang.String" db-attribute- path="FULL_NAME"/> <obj-attribute name="username" type="java.lang.String" db-attribute- path="USERNAME"/>
        </obj-entity>

<db-relationship name="toUser" source="T_KEYWORD" target="T_USER" toMany="false">
                <db-attribute-pair source="USERNAME" target="USERNAME"/>
        </db-relationship>

<db-relationship name="toKeywords" source="T_USER" target="T_KEYWORD" toDependentPK="true" toMany="true">
                <db-attribute-pair source="USERNAME" target="USERNAME"/>
        </db-relationship>

<obj-relationship name="user" source="Keyword" target="User" deleteRule="Nullify" db-relationship-path="toUser"/> <obj-relationship name="keywords" source="User" target="Keyword" deleteRule="Cascade" db-relationship-path="toKeywords"/>

Reply via email to