• Post Reply Bookmark Topic Watch Topic
  • New Topic

Even though id is same records are getting inserted in few table instead of update.  RSS feed

Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi i have bellow listed table.

Root table Customer, license (customer to license one to one relationship), product (license to product one to many relationship), module (product to module one to many relationship). i have few other master table for product and module. which i am not describing in this example for simplification.

Now when i tried to update the record. one new customer is getting inserted.

So basically i have one record for one customer, one license record which is associated with customer. one product record which is associated with license. and 2 modules records which is associated with product.
now when i tried to insert 3rd module for the same customer.

I can see one new customer entry in my customer table. where as license and product able are perfactly fine.

Bellow are some SQL statement which hibernate has printed on my console.

I have also printed the customer id from the customer object before i call the hibernate's saveOrUpdate() method

Bellow is my code for update/insert

Log file

Can anybody help me out please ??/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!