This one time, at band camp, Jose Rodriguez said:
JR>I think I found a bug with castor 0.9.3.9 (MySql).
JR>
JR>I have a one to many relation (Product and ProductDetail).
JR>
JR>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.
JR>
JR>But, if product is not define as pk, during creation, product id has a rigth value
in table productDetail.
JR>
JR>This is my mapping file:
JR>
JR> <class name="Product" identity="id" key-generator="MAX">
JR> <map-to table="product" />
JR> <field name="id" type="integer" >
JR> <sql name="productId" type="integer"/>
JR> </field>
JR> <!-- One to many with ProductDetail -->
JR> <field name="products" type="ProductDetail" required="true"
collection="vector">
JR> <sql many-key="productid"/>
JR> </field>
JR>
JR> </class>
JR>
JR> <class name="ProductDetail" identity="sequenceNumber product" depends="Product" >
JR> <map-to table="productDetail" />
JR> <field name="sequenceNumber" type="integer" >
JR> <sql name="seqno" type="integer"/>
JR> </field>
JR> <field name="product" type="Product">
JR> <sql name="productid" />
JR> </field>
JR> </class>
Jose,
Compound primary keys containing foreign keys is a defect in Castor
JDO. Here is the report:
http://bugzilla.exolab.org/show_bug.cgi?id=925
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