Hi Don,

Good to hear that you're many to many relations are working correctly. Are
you using version 0.9.3.9. I'm using the same and have one many to many
relation in my application. Addition of records is successful but I've not
been able to delete or update the ref table properly. I'm using hsqldb
database at the backend.

I've user and role tables and they are related by m-n relation.
User mapping is as follows.

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

<mapping>

<class name="com.ardec.ebf.usermgr.domain.User" identity="ID"
key-generator="UUID" >
  <description>Users</description>
 <map-to table="user" xml="user" />
 <field name="ID" type="string">
 <sql name="id" type="char" />
 <xml name="id" node="attribute"/>
   </field>
 <field name="login" type="string" >
      <sql name="login" type="char" />
      <xml name="login" node="attribute"/>
   </field>
   <field name="password" type="string" >
      <sql name="password" type="char" />
      <xml name="password" node="attribute"/>
   </field>
   <field name="active" type="boolean" >
      <sql name="active" type="bit" />
      <xml name="active" node="attribute"/>
   </field>
   <field name="roles" type="com.ardec.ebf.rolemapper.domain.Role"
required="true" collection="vector">
      <sql name="role_id" many-table="user_role_ref" many-key="user_id"/>
      <xml name="roles" node="element"/>
   </field>
  </class>

  </mapping>



Role Mapping is

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

<class name="com.ardec.ebf.rolemapper.domain.Role" identity="ID"
key-generator="UUID" access="exclusive">
 <cache-type type="none"/>
   <description>EBF Roles</description>
 <map-to table="roles" xml="role" />
 <field name="ID" type="string">
 <sql name="id" type="char" />
 <xml name="id" node="attribute"/>
   </field>
   <field name="name" type="string" >
      <sql name="name" type="char" />
      <xml name="name" node="attribute"/>
   </field>
   <field name="description" type="string" >
      <sql name="description" type="char" />
      <xml name="description" node="attribute"/>
   </field>

   <field name="users" type="com.ardec.ebf.usermgr.domain.User"
required="true" collection="vector">
       <sql name="user_id" many-table="user_role_ref" many-key="role_id"/>
       <xml name="users" node="element"/>
   </field>
  </class>

  </mapping>


Any comments and your help is deeply appreciated.

Thanks
Rabia


----- Original Message -----
From: "Don DeLuca" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 03, 2002 4:20 PM
Subject: [castor-dev] Any luck with many-to-many queries?


> Has anyone had luck building many-to-many filters in OQL?
>
> I have the many-to-many relationships working correctly for my objects,
but
> I can't generate the correct OQL to use them in a WHERE clause.
>
> Any help would be greatly appreciated.  I've scoured the mailing list and
no
> one seems to have had any luck with this.
>
> -- Don
>
> -----------------------------------------------------------
> 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