This one time, at band camp, Charles Canning said:

CC>I need to set an identity field to be an id and a key from another table
CC>which I have mapped to an object
CC>
CC>
CC>    <class name="Match" identity="userId match">
CC>        <map-to table="matches" />
CC>        <field name="userId" type="integer">
CC>            <sql name="userId" type="integer"/>
CC>        </field>
CC>        <field name="status" type="integer">
CC>            <sql name="status" type="integer"/>
CC>        </field>
CC>        <field name="ranking" type="integer">
CC>            <sql name="ranking" type="integer"/>
CC>        </field>
CC>        <field name="match" type="UserInfo">
CC>            <sql name="matchId"/>
CC>        </field>
CC>    </class>
CC>
CC>is this valid? If not, how would I proceed? I would prefer to not have to
CC>manage loading the two objects
CC>separately. Currently, I get this exception

Charles, 

Currently Castor does not allow complex objects (e.g. UserInfo) to be
used as primary keys. However, the UserInfo's identity could certainly
be used as part of the compound primary key if it was mapped as the
reference (that is, instead of the whole UserInfo object being mapped,
only map the identity field). However, doing this means  that you'd need
to manage the relationship between the Match object and the UserInfo
object by hand. Castor does not manage such a scenario.

Bruce
-- 
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project 
http://www.castor.org/

Apache Geronimo 
http://incubator.apache.org/projects/geronimo.html

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to