Hi,
In a table i need to implement composite primary key comprising of two table attributes.
in the hbm mapping file, i declared the composite id as :
<composite-id>
<key-property name="medicareNumber"/>
<key-property name="dependent"/>
</composite-id>
but when i insert data into the table having composite key, i am able to insert same values for composite key attributes for multiple records.
Some how hibernate is not able to verify the uniqueness of the composite key.
Do i need to overide the equals and hashcode method. If so what implementation is reqd so that hibernate can check for composite id uniqueness.
thnx
shankar
|