Hi, 
        When I try to load a class with all depending classes , I got 
DataObjectAccessException as following.
Type conversion error: could not set value of FieldMolder of 
myapp.Subsys.seteqSeqID(myapp.Equipment eqSeqID) with value of type 
java.math.BigDecimal
 
And I have 3 talbe like
eq : 
eq_seq_id       number  
subsys :
eq_seq_id       number  
sub_eq_id       varchar 
pmt :
sub_eq_id       varchar 
pmt_seq number  

Following is my mapping ,

  <!-- Equipment  -->
  <class name="myapp.Equipment" access="shared" identity="eqSeqID">
    <map-to table="eq" />
    <field name="eqSeqID" type="integer" required="true">
      <sql name="eq_seq_id" type="integer" />
    </field>
    <field name="subSystems" type="myapp.Subsys" collection="arraylist" >
        <sql many-key="eq_seq_id"/>
    </field>    
  </class>
  
  <class name="myapp.Subsys" access="shared" identity="eqSeqID subSysID" 
depends="myapp.Equipment" >  
        <map-to table="subsys" />
        <field name="eqSeqID" type="myapp.Equipment" required="true">
                 <sql name="eq_seq_id"/> 
        </field>
        <field name="subSysID" type="string" required="true">
                <sql name="sub_eq_id" type="varchar" />
        </field>
        <field name="payment" type="myapp.SubsysPayment" collection="hashtable" >
                <sql many-key="sub_eq_id"/>
        </field>
  </class>
 
  <class name="myapp.SubsysPayment" access="shared" identity="subSysID paymentID" 
depends="myapp.Subsys" > 
        <map-to table="pmt" />
        <field name="subSysID" type="myapp.Subsys" required="true">
                <sql name="sub_eq_id" />
        </field>
        <field name="paymentID" type="integer" required="true">
                <sql name="pymt_seq" type="integer" />
        </field>        
  </class>  

 IF I replace subsys.eqSeqID as following,
        <field name="eqSeqID" type="string" required="true">
                 <sql name="eq_seq_id" type="varchar" /> 
        </field>
then I got NullPointerException as following which due to the variable _persistence in 
ClassMolder is null.
java.lang.NullPointerException  
at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:698)     
at org.exolab.castor.persist.LockEngine.load(LockEngine.java:359)       
at org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:649)      
 
at org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:555)
at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:800) 
at org.exolab.castor.persist.LockEngine.load(LockEngine.java:359)       
at org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:649)      
 
at org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)  
at 
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:641)
      
at 
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:624)

Did anyone have this problem before ? Please help me to find out the reason. 

Thanks,
Greese
  

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

Reply via email to