A helper class for obtaining the information on persistent entities. Unlike the Persistence
and PersistenceTools
beans, this class is available on all tiers.
The PersistenceHelper
bean has the following methods:
-
isNew()
– determines if the passed instance is newly created, i.e., in the New state. Also returnstrue
if this instance is actually in Managed state but newly-persisted in the current transaction, or if it is not a persistent entity. -
isDetached()
– determines if the passed instance is in the Detached state. Also returnstrue
, if this instance is not a persistent entity. -
isSoftDeleted()
– determines if the passed entity class supports the soft deletion. -
getEntityName()
– returns the name of the entity specified in the @Entity annotation.