JPA - Managed Entity
future updates to the entity will be tracked.
The behavior is undefined if the same Java instance is made managed in more than one persistence context
The contains() method can be used to determine whether an entity instance is managed in the current persistence context.
The contains method returns true:
The contains method returns false:
- If the instance is detached.
- If the instance is new, and the persist method has not been called on the entity or the persist operation has not been cascaded to it.
Documentation / Reference
- Chapter 3.2.8 Managed Instances from the specifications