|
Description:
|
I have three tables PRODUCT(id,name),RESOURCE(id,,name),PRODUCT_T_RESOURCE(PRODUCT_ID,RESOURCE_ID,DEPENDENCY)
Here PRODUCT_T_RESOURCE tabel has composite key
I have 4 POJO
Product,Resource,ProductTResource,ProductTResourceID
For details see attached doc.
Problem:
While updating a record, Hibernate is not able to delete from transaction table having composite key
Ex.Let's suppose PRODUCT_T_RESOURCE have record
PRODUCT_ID RESOURCE_ID DEPENDENCY
1 2 ABC
1 1 AS
Now I am trying to update my product with resource_id 2,3(1 I don't want)
On calling Update() method hibernate add new record but doesn't delete older records
Now tabel is like
PRODUCT_ID RESOURCE_ID DEPENDENCY
1 2 ABCD
1 1 AS
1 3 DSF
Record 1,1,AS shouldn't be here.
|