Is there a way to get a list of “known” Entity instances for a given Session / EntityManager in JPA / Hibernate 4.x?
By "known" is meant either loaded, created or modified, i.e. A managed entity that exists in the context of persistence. I know the method EntityManager#contains, so I assume that such a list is supported, but how can I get to it?
EDIT: Also, how can I query the state of a persistent entity (check if it is created, updated, deleted, or cleared in this persistence context)?
source
share