Google News
logo
JPA - Interview Questions
How does the operation persist on Entity objects of each of the four statuses?
* If the status is Entity new, then it changes to managed and the object will be saved to the database when a transaction is committed or as a result of flush operations,
 
* If the status is already managed, the operation is ignored, but dependent Entity can change the status to managed, if there are annotations of cascading changes,
 
* If the status is removed, then it changes to managed,
 
* If the status is detached, the exception will be thrown right away or at the commit stage of the transaction.
Advertisement