here is my code snippet:
 
jdo = new JDO("mydb");
jdo.setConfiguration("database.xml" );
db = jdo.getDatabase();//get error when execute here
db.begin();
 
oql = db.getOQLQuery( "select c from JdoTest c ");//where id=$1 " );
... 
 
here is my database.xml:
 
!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 1.0//EN"
                           "
http://castor.exolab.org/jdo-conf.dtd">
                          
<database name="mydb" engine="oracle">
    <driver class-name="oracle.jdbc.driver.OracleDriver"
   url="jdbc:oracle:thin:@127.0.0.1:1521:dba">
      <param name="user" value="system" />
      <param name="password" value="manager" />
    </driver>
    <mapping href="./mapping.xml" />
   </database>
and the mapping.xml:
 
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
                           "
http://castor.exolab.org/mapping.dtd">
<mapping>
 
  <!--  Mapping for ProductGroup  -->
  <class name="JdoTest" identity="id" access="shared">
    <description>my jdo test</description>
    <map-to table="a" xml="group" />
    <field name="A" type="integer" >
      <sql name="A" type="number"/>
      <xml node="attribute"/>
    </field>
  
  </class>
</mapping>
when i compile and run it,the screen display these message:
 
org.exolab.castor.mapping.MappingException: The method getA in class JdoTest acc
epting/returning object of type int was not found
        at org.exolab.castor.mapping.loader.MappingLoader.createFieldDesc(Unknow
n Source)
        at org.exolab.castor.jdo.engine.JDOMappingLoader.createFieldDesc(Unknown
 Source)
        at org.exolab.castor.mapping.loader.MappingLoader.createFieldDescs(Unkno
wn Source)
        at org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(Unkno
wn Source)
        at org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(Unknow
n Source)
        at org.exolab.castor.mapping.loader.MappingLoader.loadMapping(Unknown So
urce)
        at org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(Unknown Sou
rce)
        at org.exolab.castor.mapping.Mapping.getResolver(Unknown Source)
        at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(Unknown So
urce)
        at org.exolab.castor.jdo.JDO.getDatabase(Unknown Source)
        at JdoTest.test(JdoTest.java:47)
        at JdoTest.main(JdoTest.java:79)
 
i don't know where the error lie in,who can give me advice?
i am really know little about CASTORJDO:(
thank a lot
 
Best Regards,

peter collias
 

Reply via email to