Hi,

I need to set an identity field to be an id and a key from another table
which I have mapped to an object


    <class name="Match" identity="userId match">
        <map-to table="matches" />
        <field name="userId" type="integer">
            <sql name="userId" type="integer"/>
        </field>
        <field name="status" type="integer">
            <sql name="status" type="integer"/>
        </field>
        <field name="ranking" type="integer">
            <sql name="ranking" type="integer"/>
        </field>
        <field name="match" type="UserInfo">
            <sql name="matchId"/>
        </field>
    </class>

is this valid? If not, how would I proceed? I would prefer to not have to
manage loading the two objects
separately. Currently, I get this exception

java.lang.IllegalStateException: Transaction
[EMAIL PROTECTED] does not hold the
read lock: Match/<41(41),36(36)>/1 -/-!
        at
org.exolab.castor.persist.LockEngine$TypeInfo.assure(LockEngine.java:1160)
        at
org.exolab.castor.persist.LockEngine$TypeInfo.access$500(LockEngine.java:963
)
        at
org.exolab.castor.persist.LockEngine.revertObject(LockEngine.java:859)
        at
org.exolab.castor.persist.TransactionContext.rollback(TransactionContext.jav
a:1720)
        at
org.exolab.castor.jdo.engine.DatabaseImpl.rollback(DatabaseImpl.java:552)
        ...

org.exolab.castor.jdo.DataObjectAccessException: Type conversion error:
could not set value of FieldMolder of Match.setmatch(UserInfo match) with
value of type java.lang.Integer
        at
org.exolab.castor.persist.FieldMolder.setValue(FieldMolder.java:330)
        at
org.exolab.castor.persist.ClassMolder.setIdentity(ClassMolder.java:2738)
        at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:707)
        at org.exolab.castor.persist.LockEngine.load(LockEngine.java:359)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:64
9)
        at
org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
l.java:641)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
l.java:624)
          ....

All help is greatly appreciated.

Chuck

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

Reply via email to