I was able to do this with using a Set. But now need to try it with a Map.
This is the way i gave the mapping which is in the Product.hbm.xml
:
Quote:
<map name="product_parts" table="PRODUCT_PART">
<key column="PRODUCT_CODE" not-null="true"/>
<map-key type="java.lang.String" column="PART_ID" />
<many-to-many class="eg.Part" column="PART_CODE"/>
</map>
I have DAO s and HBM s only for the PRODUCT and PART tables. PRODUCT_PART is a pure resolving table, which does not have a DAO and is mapped in the PRODUCT hbm.xml as shown above.
This gives an invalid column exception when a query is executed. But there arn't any mapping error at the JBoss start up.
thanks
Shanika