Google News
logo
JPA - Interview Questions
How does the remove operation affect the Entity objects of each of the four statuses?
* If the status is Entity new, the operation is ignored, however dependent Entity can change the status to removed, if they have cascading change annotations and they had the status managed,
 
* If the status is managed, then the status changes to removed and the object is recorded in the database removed during commit commit (remove operations will also occur for all cascade-dependent objects),
 
* If status is removed, then the operation is ignored,
 
* If detached, exception is thrown right away or at the commit stage of a transaction.
Advertisement