Took the example given on castor website with little change. I have similar
issue and I am not getting any rows from the details table.
Pls help.
---------------------------------------
create table prod
(
id int not null,
name varchar(200) not null,
price numeric(18,2) not null,
group_id int not null
);(primarykey=prod_id)
create table prod_detail (
detail_id int not null,
prod_id int not null,
name varchar(200) not null
);// primarykey=(detail_id, prod_id)
id in prod table is same as prod_id in prod_detail
What should be the mapping between prod and prod_detail? to find all the
prod_detail rows for given id in prod? I am sure the exitsing mapping would not
be correct. What changes are to be made to the below mapping because the
primary-key of prod_detail table changed from detail_id to (detail_id,
prod_id)?
<class name="myapp.Product" identity="id">
<map-to table="prod" />
<field name="id" type="integer">
<sql name="id" type="integer" />
</field>
---
---
---
<field name="details" type="myapp.ProductDetail" collection="vector">
<sql many-key="prod_id"/>
</field>
</class>
<class name="myapp.ProductDetail" identity="detail_id product"
depends="myapp.Product" >
<description>Product detail</description>
<map-to table="prod_detail" />
<field name="detail_id" type="integer">
<sql name="detail_id" type="integer"/>
</field>
<field name="name" type="string">
<sql name="name" type="char"/>
</field>
<field name="product" type="myapp.Product">
<sql name="prod_id" />
</field>
/class>
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------