u need a set method that accept a collection parameter for your li field

-----Original Message-----
From: Dmitry Macsema [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 4:03
To: [EMAIL PROTECTED]
Subject: [castor-dev] lazy initialization problem



I'm trying to use lazy initialization and get an exception (see
below). If I turn LI off, everything works fine.

Exception in thread "main" org.exolab.castor.jdo.DataObjectAccessException:
no m
ethod to set value for field: ryba.winlock.CompEvent in class: ClassMolder
ryba.
winlock.Computer
        at
org.exolab.castor.persist.FieldMolder.setValue(FieldMolder.java:310)
        at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:755)
        at org.exolab.castor.persist.LockEngine.load(LockEngine.java:361)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.
java:545)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.
java:479)
        at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:742)
        at org.exolab.castor.persist.LockEngine.load(LockEngine.java:361)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.
java:545)
        at
org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.next(OQLQuer
yImpl.java:643)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.next(OQLQuer
yImpl.java:616)
        at ryba.winlock.LockManager.<init>(LockManager.java:37)
        at ryba.winlock.LockManager.main(LockManager.java:52)

Here's mapping;
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
                           "http://castor.exolab.org/mapping.dtd";>
<mapping>
  <description>Locker database mapping</description>

  <class name="ryba.winlock.Cafe" identity="id" key-generator="MAX">
    <description>Internet cafe</description>
    <map-to table="cafe"/>
    <field name="id" type="integer" required="true">
      <sql name="cafe_id" type="integer"/>
    </field>
    <field name="name" type="java.lang.String" required="true">
      <sql name="name" type="varchar"/>
    </field>
    <field name="Computers" type="ryba.winlock.Computer"
collection="collection"/>
  </class>

  <class name="ryba.winlock.Computer" identity="id" key-generator="MAX" 
                                        depends="ryba.winlock.Cafe">
    <map-to table="computer"/>
    <field name="id" type="integer" required="true">
      <sql name="computer_id" type="integer"/>
    </field>
    <field name="cafe" type="ryba.winlock.Cafe" required="true">
      <sql name="cafe_id"/>
    </field>
    <field name="name" type="java.lang.String" required="true">
      <sql name="name" type="varchar"/>
    </field>
    <field name="IP" type="java.lang.String" required="true">
      <sql name="ip" type="varchar"/>
    </field>
    <field name="CompEvents" type="ryba.winlock.CompEvent"
collection="collection"
    lazy="true"/>
  </class>

  <class name="ryba.winlock.CompEvent" identity="id" key-generator="MAX" 
                                        depends="ryba.winlock.Computer">
    <map-to table="compevent"/>
    <field name="id" type="integer" required="true">
      <sql name="compevent_id" type="integer"/>
    </field>
    <field name="computer" type="ryba.winlock.Computer" required="true">
      <sql name="computer_id"/>
    </field>
    <field name="operation" type="ryba.winlock.Operation" required="true">
      <sql name="operation_id"/>
    </field>
    <field name="time" required="true">
      <sql name="evttime" type="timestamp"/>
    </field>
  </class>

  <class name="ryba.winlock.Operation" identity="id" key-generator="MAX">
    <map-to table="operation"/>
    <field name="id" type="integer" required="true">
      <sql name="operation_id" type="integer"/>
    </field>
    <field name="name" type="java.lang.String" required="true">
      <sql name="name" type="varchar"/>
    </field>
  </class>

</mapping>
        

-- 
Best regards,
 Dmitry                          mailto:[EMAIL PROTECTED]

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

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

Reply via email to