I've reached the conclusion that the many-to-many implementation in castor
CVS version does not work properly.

consider two classes

<mapping>
        <class name="com.againtech.ce.ds.role.RoleImpl" identity="UUID">
                <cache-type type="unlimited"/>
                <description>Role Implementation</description>
                <map-to table="ROLE" xml="Role"/>
                <!--the primary key field -->
                <field name="UUID" type="string">
                        <sql name="role_uuid" type="varchar"/>
                </field>
                <!-- attributes -->
                <field name="name" type="string">
                        <sql name="role_name" type="varchar"/>
                </field>
                <field name="users" type="com.againtech.ce.ds.user.UserImpl"
required="true" collection="arraylist">
                        <sql name="user_uuid" many-table="USER_ROLE" 
many-key="role_uuid" />
                </field>
                <field name="privilegeProxies"
type="com.againtech.ce.ds.privilege.PrivilegeProxyImpl" required="true"
collection="arraylist">
                        <sql many-key="role_uuid"/>
                </field>

        </class>
</mapping>

and

<mapping>
        <class name="com.againtech.ce.ds.privilege.PrivilegeProxyImpl"
identity="UUID" depends="com.againtech.ce.ds.role.RoleImpl>
        <cache-type type="unlimited"/>
                <description>PrivilegeProxy Implementation</description>
                <map-to table="ROLE_PRIVILEGE" xml="PrivilegeProxy"/>
                <!--the primary key field -->
                <field name="UUID" type="string">
                        <sql name="role_privilege_uuid" type="varchar"/>
                </field>
                <!-- attributes -->
                <field name="role" type="com.againtech.ce.ds.role.RoleImpl">
                        <sql name="role_uuid"/>
                </field>
                <field name="proxiedPrivilegeUUID" type="string">
                        <sql name="privilege_uuid" type="varchar"/>
                </field>
        </class>
</mapping>

If I try to create a role with associated privileges, it dies, because the
dependent object it tries to create is a UserImpl, not a privilegeproxyimpl.

anyway. I'm too tired to explain right now, but I want to know if the castor
gang knows the status of many-to-many.

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

Reply via email to