I have two classes,
ComponentType and
ProductComponentTemplate that map to the same table. Also,
ComponentType is the key/identifier for
ProductComponentTemplate.
For some reason, when I map composite-id of ProductComponentTemplate like so:
Code:
<class name="com.nppc.mes.productsupply.productdefinition.ProductComponentTemplate" table="GPMQ.CMPNT_TYPE">
<composite-id>
<key-many-to-one
name="typeReference"
column="CMPNT_TYP_C"
class="com.nppc.mes.productsupply.reference.product.ComponentType"/>
</composite-id>
</class>
I get a dirty session when I read ProductComponentTemplate. How do I do the mapping in this case, so that session does not get dirty?
I have mapped other composite-id elements and don't have this issue. The only difference is that the composite-id and class being mapped share the same table.
Seems like I should be defining a COMPONENT here, but not sure how to make that all work.