Hi Bruce,

Sorry, I'm so stupid. While extracting the relevant part from my application
i found the error. It was in the databese.xml, that i got from another
oracle-application without many-to-many-mapping:
...
<database name="CASTOR" engine="sybase" >
<driver class-name="oracle.jdbc.driver.OracleDriver"
            url="jdbc:oracle:thin:@enterprise:1521:utfdb">
...
Sybase and oracle seems to be largely compatible, so this error
didn't occured before.
Sorry and thanks for your efforts,
Steffen

Bruce Snyder wrote:
  >SF>I posted this already but found no solution despite
  >SF>I looked at all the castor-examples and couldn't find any mistake.
  >SF>I work with Oracle 8i (8.1.7.) and Castor 0.9.4.
  >SF>When I use mySQL or PostreSQL, the same example works (just exchanging
  >SF>the database.xml), so i think it could be a bug.
  >SF>My oracle-driver is up to date, and when i remove the many-to-many
field
  >SF>from mapping.xml it works with oracle too.
  >SF>
  >SF>
  >SF>Here is the problem again, a simple many-to-many relation mapping
  >SF>
  >SF>my mapping.xml:
  >SF>[...]
  >SF><class name="com.xyz.access.User" identity="id">
  >SF>     <map-to table="USERS"/>
  >SF>
  >SF>     <field name="id" type="integer" >
  >SF>       <sql name="ID" type="integer"/>
  >SF>       <xml node="attribute"/>
  >SF>     </field>
  >SF>
  >SF>     <field name="name" type="string">
  >SF>       <sql name="NAME" type="char" dirty="check" />
  >SF>       <xml node="text" />
  >SF>     </field>
  >SF>
  >SF>     <field name="password" type="string">
  >SF>       <sql name="PASSWORD" type="char" dirty="check" />
  >SF>       <xml node="text" />
  >SF>     </field>
  >SF>
  >SF>     <field name="roles" type="com.xyz.workflows.Role"
  >SF>collection="arraylist">
  >SF>       <sql name="ROLE_ID" many-table="ROLES_USERS"
many-key="USER_ID"/>
  >SF>     </field>
  >SF></class>
  >SF>
  >SF><class name="com.xyz.workflows.Role"  identity="id">
  >SF>     <map-to table="ROLES"/>
  >SF>
  >SF>     <field name="id" type="integer" >
  >SF>       <sql name="ID" type="integer"/>
  >SF>       <xml node="attribute"/>
  >SF>     </field>
  >SF>
  >SF>     <field name="name" type="string">
  >SF>       <sql name="NAME" type="char" dirty="check" />
  >SF>       <xml node="text" />
  >SF>     </field>
  >SF>
  >SF>   <field name="users" type="com.xyz.access.User"
collection="arraylist">
  >SF>      <sql name="USER_ID" many-table="ROLES_USERS" 
many-key="ROLE_ID"/>
  >SF>   </field>
  >SF></class>
  >SF>[...]
  >SF>
  >SF>and my sql-tables:
  >SF>USERS:
  >SF>     ID        NUMBER
  >SF>     NAME      VARCHAR
  >SF>     PASSWORD  VARCHAR
  >SF>ROLES:
  >SF>     ID        NUMBER
  >SF>     NAME      VARCHAR
  >SF>ROLES_USERS:
  >SF>     ID        NUMBER
  >SF>     ROLE_ID   NUMBER
  >SF>     USER_ID   NUMBER
  >SF>
  >SF>When i execute any OQL-query like 'OQL-Querry: SELECT id FROM
  >SF>com.xyz.access.User id where
  >SF>name="superuser"' i get the error-message: java.sql.SQLException:
  >SF>ORA-00936: missing expression.
  >SF>
  >SF>Could anyone confirm or refute this claim?
  >
  >Steffen,
  >
  >I just paired down the JDO examples to only make use of the Product and
  >he Category. My test runs just fine against Oracle9i (Oracle9i Enterprise
  >Edition Release 9.0.1.3.0 - 64bit Production) using the classes12.zip
  >JDBC drivers running on Solaris 8. My test client is running on RedHat
  >Linux 7.3.
  >
  >Here's the mapping descriptor:
  >
  >    <class name="myapp.Product" identity="id">
  >      <map-to table="prod" xml="product" />
  >      <field name="id" type="integer">
  >        <sql name="id" type="integer" />
  >      </field>
  >      <field name="name" type="string">
  >        <sql name="name" type="char" />
  >      </field>
  >      <field name="price" type="float">
  >        <sql name="price" type="numeric" />
  >      </field>
  >      <field name="categories" type="myapp.Category" required="true"
  >collection="arraylist">
  >        <sql name="category_id" many-table="category_prod"
many-key="prod_id" />
  >      </field>
  >    </class>
  >
  >    <class name="myapp.Category" identity="id">
  >      <map-to table="category" xml="category" />
  >      <field name="id" type="integer">
  >        <sql name="id" type="integer"/>
  >      </field>
  >      <field name="name" type="string">
  >        <sql name="name" type="char"/>
  >    </field>
  >      <field name="products" type="myapp.Product" required="true"
  >collection="arraylist">
  >        <sql name="prod_id" many-table="category_prod"
many-key="category_id" />
  >      </field>
  >    </class>
  >
  >Here's the DDL:
  >
  >    drop table prod;
  >    create table prod (
  >      id        int not null,
  >      name      varchar(200) not null,
  >      price     numeric(18,2) not null
  >    );
  >
  >    drop table category;
  >    create table category (
  >      id   int not null,
  >      name varchar(200) not null
  >    );
  >
  >    drop table category_prod;
  >    create table category_prod (
  >      prod_id   int not null,
  >      category_id   int not null
  >    );
  >
  >Can you jar up your test case and send it to me?
  >
  >Bruce
  >--
  >perl -e 'print unpack("u30","<0G)U8V4 @4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

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

Reply via email to