Hi,

I'm just getting started with Castor and I'm having a problem storing a
couple of objects.  I have a ResourcePool object that has a field of type
ResourcePoolType.  I can successfully create and persist instance of both
object types however the id of the ResourcePoolType is not stored in the db
record of the ResourcePool object.

My mapping.xml follows:

<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.exolab.org/mapping.dtd";>
<mapping>
   <key-generator name="SEQUENCE">
    <param name="sequence" value="global_seq"/>
  </key-generator>

        <!--  Mapping for ServicePackage  -->
        <class name="com.abc.configuration.jdo.ServicePackage" identity="id"
key-generator="SEQUENCE">
                <description>Service Package</description>
                <map-to table="service_packages" xml="servicePackage"/>
                <field name="id" type="integer">
                        <sql name="id" type="integer"/>
                </field>
                <field name="name" type="string">
                        <sql name="name" type="varchar"/>
                </field>
                <field name="description" type="string">
                        <sql name="description" type="varchar"/>
                </field>
        </class>

   <!--  Mapping for Services  -->
        <class name="com.abc.configuration.jdo.Service" identity="id"
key-generator="SEQUENCE">
                <description>Service</description>
                <map-to table="services" xml="service"/>
                <field name="id" type="integer">
                        <sql name="id" type="integer"/>
                </field>
                <field name="name" type="string">
                        <sql name="name" type="varchar"/>
                </field>
                        <field name="description" type="string">
                        <sql name="description" type="varchar"/>
                </field>
        </class>

   <!--  Mapping for Resource Pool Types  -->
        <class name="com.abc.configuration.jdo.ResourcePoolType"
identity="id" key-generator="SEQUENCE">
                <description>Resource Pool Type</description>
                <map-to table="resource_pool_types" xml="resourcePoolType"/>
                <field name="id" type="integer">
                        <sql name="id" type="integer"/>
                </field>
                <field name="name" type="string">
                        <sql name="name" type="varchar"/>
                </field>
                        <field name="description" type="string">
                        <sql name="description" type="varchar"/>
                </field>
        </class>

      <!--  Mapping for Resource Pools  -->
        <class name="com.abc.configuration.jdo.ResourcePool" identity="id"
key-generator="SEQUENCE">
                <description>Resource Pool Type</description>
                <map-to table="resource_pools" xml="resourcePool"/>
                <field name="id" type="integer">
                        <sql name="id" type="integer"/>
                </field>
                <field name="name" type="string">
                        <sql name="name" type="varchar"/>
                </field>
      <field name="description" type="string">
                        <sql name="description" type="varchar"/>
                </field>
      <field name="shared" type="boolean">
                        <sql name="shared" type="char"/>
                </field>
      <field name="type" type="com.abc.configuration.jdo.ResourcePoolType">
         <sql name="type_id"/>
      </field>
        </class>
</mapping>

Can anyone help me figure out why the relationship between ResourcePoolType
and ResourcePool isn't being persisted?

Thanks in advance,

Stephen Earl

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

Reply via email to