S
ses
I have an EJB entity relationship like the following
Customer ---one-many---> Booking
Location ---one-many---> Booking
Firstly I persist the booking. The problem is when I try to add the
same Booking entity to both Customer and Location, and then merge
customer and location the only relationship which remains in the
database is the one for which merge was called last.
This indicates that an individual Booking can only be 'owned' by one
entity, why is this the case and how can I circumvent it? Any
suggestions would be gratefully appreciated.
I'm using JPA with eager fetch type and orphan removal.
Customer ---one-many---> Booking
Location ---one-many---> Booking
Firstly I persist the booking. The problem is when I try to add the
same Booking entity to both Customer and Location, and then merge
customer and location the only relationship which remains in the
database is the one for which merge was called last.
This indicates that an individual Booking can only be 'owned' by one
entity, why is this the case and how can I circumvent it? Any
suggestions would be gratefully appreciated.
I'm using JPA with eager fetch type and orphan removal.