This one time, at band camp, Craig M. Anderson said:

CMA>  <!-- Role Table Mapping. -->
CMA>  <class name="com.searchdog.sysadmin.application.Role" identity="id">
CMA>    <map-to table="role" />
CMA>    <field name="id">
CMA>      <sql name="id" type="integer" />
CMA>    </field>
CMA>    <field name="name" type="string" required="true">
CMA>      <sql name="name" type="varchar" />
CMA>    </field>
CMA>  </class>
CMA>
CMA>  <!-- User ID Sequence Mapping. -->
CMA>  <key-generator name="SEQUENCE" alias="UserID">
CMA>    <param name="sequence" value="user_id_seq"/> 
CMA>  </key-generator>
CMA>
CMA>  <!-- User Table Mapping. -->
CMA>  <class name="com.searchdog.sysadmin.application.User" identity="id" 
key-generator="UserID">
CMA>    <map-to table="user" />
CMA>    <field name="id">
CMA>      <sql name="id" type="integer" />
CMA>    </field>
CMA>    <field name="firstName" type="string" required="true">
CMA>      <sql name="firstname" type="varchar" />
CMA>    </field>
CMA>    <field name="lastName" type="string" required="true">
CMA>      <sql name="lastname" type="varchar" />
CMA>    </field>
CMA>    <field name="email" type="string" required="true">
CMA>      <sql name="email" type="varchar" />
CMA>    </field>
CMA>    <field name="password" type="string" required="true">
CMA>      <sql name="password" type="varchar" />
CMA>    </field>
CMA>
CMA>    <!-- User Table References Role Table. -->
CMA>    <field name="role" type="com.searchdog.sysadmin.application.Role">
CMA>      <sql name="role" />
CMA>    </field>
CMA>    
CMA>    <!-- User Table References Company Table. Many-To-Many. -->
CMA>    <field name="companies" type="com.searchdog.sysadmin.application.Company" 
required="false" collection="vector">
CMA>      <sql name="companyid" many-table="user_company_rel" many-key="userid"/>
CMA>    </field>
CMA>  </class>

Craig, 

I'm not sure if this would affect your situation, but I notice that
the relationship between the User object and the Role object is not
bi-directional. There's an explanation of this in the JDO FAQ but it
hasn't yet been published to the website. Here is the FAQ:

-----------------------------------------------------------------------
    Does Castor support both one-way and two-way relationships?

    Typcially a relationship between two objects is either one-way (aka
    uni-directional) or two-way (aka bi-directional). Officially, Castor
    currently only supports bi-directional relationships. For example,
    if an Order object contains a reference to a LineItem object, the
    LineItem object must contain a reference to the Order object. However,
    this requirement is not enforced in all situations.

    This is a very complex problem to solve.  So until Castor is expanded the
    support uni-directional relationships, the best policy is to implement
    the bi-directionalality for all relationships. This will ensure proper
    functionality.
-----------------------------------------------------------------------

Change this relationship and see what the outcome is for your test. 

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