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