Hi,

I think I found a bug with castor 0.9.3.9 (MySql).

I have a one to many relation (Product and ProductDetail). 

The pb appears when: ProductDetail has two pks (product and a sequence number). I 
create a new record and product value id is wrong (always equals to 0) in table 
productDetail.

But, if product is not define as pk, during creation, product id has a rigth value in 
table productDetail.

This is my mapping file:

  <class name="Product"  identity="id" key-generator="MAX">
      <map-to table="product" />
      <field name="id" type="integer" >
        <sql name="productId" type="integer"/>
      </field>   
      <!-- One to many with ProductDetail -->
      <field name="products" type="ProductDetail" required="true"   
collection="vector">
        <sql many-key="productid"/>
      </field>
      
  </class>

  <class name="ProductDetail"  identity="sequenceNumber product" depends="Product" >
    <map-to table="productDetail" />  
    <field name="sequenceNumber" type="integer" >
      <sql name="seqno" type="integer"/>
    </field>
    <field name="product" type="Product">
        <sql name="productid" />
    </field>
  </class>        


If I am wrong please tell me...

J.

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

Reply via email to