public class NucleusJPAHelper extends Object
Constructor and Description |
---|
NucleusJPAHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
getDatastoreIdForEntity(Object obj)
Convenience method to allow access to the datastore id of an object when it is using DN Extension "datastore-id".
|
static Object[] |
getDetachedStateForObject(Object obj)
Accessor for the jdoDetachedState field of a detached object.
|
static String[] |
getDirtyFields(Object obj,
javax.persistence.EntityManager em)
Accessor for the names of the dirty fields of the persistable object.
|
static javax.persistence.EntityManager |
getEntityManager(Object obj)
Accessor for the EntityManager for the supplied (persistable) object.
|
static javax.persistence.PersistenceException |
getJPAExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
Convenience method to convert a Nucleus exception into a JPA exception.
|
static String[] |
getLoadedFields(Object obj,
javax.persistence.EntityManager em)
Accessor for the names of the loaded fields of the persistable object.
|
static Object |
getObjectId(Object obj) |
static String |
getObjectState(Object obj)
Convenience method to return a string of the state of an object.
|
static Object |
getSurrogateVersionForEntity(Object obj)
Convenience method to allow access to the version of an object when it is using DN Extension "surrogate-version".
|
static boolean |
isDeleted(Object obj)
Convenience accessor for whether the object is deleted.
|
static boolean |
isDetached(Object obj)
Convenience accessor for whether the object is detached.
|
static boolean |
isPersistent(Object obj)
Convenience accessor for whether the object is persistent.
|
static boolean |
isTransactional(Object obj)
Convenience accessor for whether the object is transactional.
|
public static Object getSurrogateVersionForEntity(Object obj)
obj
- The entity objectpublic static Object getDatastoreIdForEntity(Object obj)
obj
- The entity objectpublic static javax.persistence.EntityManager getEntityManager(Object obj)
obj
- The persistable objectpublic static boolean isPersistent(Object obj)
obj
- The objectpublic static boolean isDeleted(Object obj)
obj
- The objectpublic static boolean isDetached(Object obj)
obj
- The objectpublic static boolean isTransactional(Object obj)
obj
- The objectpublic static String getObjectState(Object obj)
obj
- The objectpublic static Object[] getDetachedStateForObject(Object obj)
obj
- The detached objectpublic static String[] getDirtyFields(Object obj, javax.persistence.EntityManager em)
obj
- The persistable objectem
- The Entity Manager (only required if the object is detached)public static String[] getLoadedFields(Object obj, javax.persistence.EntityManager em)
obj
- Persistable objectem
- The Entity Manager (only required if the object is detached)public static javax.persistence.PersistenceException getJPAExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
ne
- NucleusExceptionCopyright © 2020. All rights reserved.