|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.jpa.JPAAdapter
public class JPAAdapter
Adapter for the JPA API, to allow the DataNucleus core runtime to expose multiple APIs to clients.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER
|
| Constructor Summary | |
|---|---|
JPAAdapter()
|
|
| Method Summary | |
|---|---|
boolean |
allowDeleteOfNonPersistentObject()
Whether the API allows deletion of a non-persistent object. |
boolean |
allowPersistOfDeletedObject()
Whether the API allows (re-)persistence of a deleted object. |
boolean |
allowReadFieldOfDeletedObject()
Whether the API allows reading a field of a deleted object. |
boolean |
clearLoadedFlagsOnDeleteObject()
Whether the API requires clearing of the fields of an object when it is deleted. |
boolean |
getDefaultCascadeDeleteForField()
Returns the default cascade-delete setting. |
boolean |
getDefaultCascadePersistForField()
Returns the default cascade-persist setting. |
boolean |
getDefaultCascadeRefreshForField()
Returns the default cascade-refresh setting. |
boolean |
getDefaultCascadeUpdateForField()
Returns the default cascade-update setting. |
java.util.Map |
getDefaultFactoryProperties()
Method to return the default factory properties for this API. |
java.lang.RuntimeException |
getExceptionForException(java.lang.String msg,
java.lang.Exception e)
Convenience method to return an exception to throw for this API when an unexpected exception occurs. |
java.lang.Object |
getIdForObject(java.lang.Object obj)
Method to return the object identity for the passed persistable object. |
java.lang.Class |
getKeyTypeForSingleFieldIdentityType(java.lang.Class idType)
Accessor for the type of the single field application-identity key given the single field identity type. |
org.datanucleus.state.LifeCycleState |
getLifeCycleState(int stateType)
Returns the LifeCycleState for the state constant. |
java.lang.String |
getName()
Accessor for the name of the API. |
java.lang.Object |
getNewApplicationIdentityObjectId(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.metadata.AbstractClassMetaData acmd,
java.lang.String value)
Utility to create a new application identity when you know the metadata for the target class, and the toString() output of the identity. |
java.lang.Object |
getNewApplicationIdentityObjectId(java.lang.Class cls,
java.lang.Object key)
Method to return a new object identity for the specified class, and key (possibly toString() output). |
java.lang.Object |
getNewApplicationIdentityObjectId(java.lang.Object pc,
org.datanucleus.metadata.AbstractClassMetaData cmd)
Method to create a new object identity for the passed object with the supplied MetaData. |
java.lang.Object |
getNewSingleFieldIdentity(java.lang.Class idType,
java.lang.Class pcType,
java.lang.Object value)
Utility to create a new SingleFieldIdentity using reflection when you know the type of the PersistenceCapable, and also which SingleFieldIdentity, and the value of the key. |
java.lang.Object |
getObjectId(org.datanucleus.StateManager sm)
Accessor for the object id from the StateManager for this object. |
org.datanucleus.ObjectManager |
getObjectManager(java.lang.Object obj)
Method to return the ObjectManager (if any) associated with the passed object. |
java.lang.String |
getObjectState(java.lang.Object obj)
Accessor for the object state. |
java.lang.Object |
getPersistenceManager(java.lang.Object obj)
Accessor for the persistence manager for this object. |
java.lang.String |
getSingleFieldIdentityClassNameForByte()
Accessor for the class name to use for identities when there is a single Byte/byte field. |
java.lang.String |
getSingleFieldIdentityClassNameForChar()
Accessor for the class name to use for identities when there is a single Character/char field. |
java.lang.String |
getSingleFieldIdentityClassNameForInt()
Accessor for the class name to use for identities when there is a single Integer/int field. |
java.lang.String |
getSingleFieldIdentityClassNameForLong()
Accessor for the class name to use for identities when there is a single Long/long field. |
java.lang.String |
getSingleFieldIdentityClassNameForObject()
Accessor for the class name to use for identities when there is a single Object field. |
java.lang.String |
getSingleFieldIdentityClassNameForShort()
Accessor for the class name to use for identities when there is a single Short/short field. |
java.lang.String |
getSingleFieldIdentityClassNameForString()
Accessor for the class name to use for identities when there is a single String field. |
java.lang.Class |
getTargetClassForSingleFieldIdentity(java.lang.Object id)
Accessor for the target class for the specified single field application-identity. |
java.lang.String |
getTargetClassNameForSingleFieldIdentity(java.lang.Object id)
Accessor for the target class name for the specified single field identity. |
java.lang.Object |
getTargetKeyForSingleFieldIdentity(java.lang.Object id)
Accessor for the key object for the specified single field application-identity. |
java.lang.Object |
getVersion(org.datanucleus.StateManager sm)
Accessor for the version from the StateManager for this object. |
java.lang.Object |
getVersionForObject(java.lang.Object obj)
Method to return the object version for the passed persistable object. |
boolean |
isDeleted(java.lang.Object obj)
Accessor for whether the passed object is deleted. |
boolean |
isDetachable(java.lang.Object obj)
Method to return if the passed object is detachable using this API. |
boolean |
isDetached(java.lang.Object obj)
Accessor for whether the passed object is detached. |
boolean |
isDirty(java.lang.Object obj)
Accessor for whether the passed object is dirty. |
boolean |
isLoaded(org.datanucleus.StateManager sm,
int fieldNumber)
Accessor for whether a field is loaded for the object managed by the StateManager |
boolean |
isNew(java.lang.Object obj)
Accessor for whether the passed object is new. |
boolean |
isPersistable(java.lang.Class cls)
Utility method to check if the specified class is of a type that can be persisted for this API. |
boolean |
isPersistable(java.lang.Object obj)
Method to return if the passed object is persistable using this API. |
boolean |
isPersistent(java.lang.Object obj)
Accessor for whether the passed object is persistent. |
boolean |
isSingleFieldIdentity(java.lang.Object id)
Accessor for whether the passed identity is a valid single-field application-identity for this API. |
boolean |
isSingleFieldIdentityClass(java.lang.String className)
Checks whether the passed class name is valid for a single field application-identity for this API. |
boolean |
isTransactional(java.lang.Object obj)
Accessor for whether the passed object is transactional. |
boolean |
isValidPrimaryKeyClass(java.lang.Class pkClass,
org.datanucleus.metadata.AbstractClassMetaData cmd,
org.datanucleus.ClassLoaderResolver clr,
int noOfPkFields)
Utility to check if a primary-key class is valid. |
void |
makeFieldDirty(java.lang.Object obj,
java.lang.String fieldName)
Method to make the field dirty in the object. |
org.datanucleus.StateManager |
newStateManager(org.datanucleus.ObjectManager om,
org.datanucleus.metadata.AbstractClassMetaData acmd)
Method to create a new StateManager for the ObjectManager and class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER
| Constructor Detail |
|---|
public JPAAdapter()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface org.datanucleus.api.ApiAdapterpublic org.datanucleus.ObjectManager getObjectManager(java.lang.Object obj)
getObjectManager in interface org.datanucleus.api.ApiAdapterobj - The object
public org.datanucleus.StateManager newStateManager(org.datanucleus.ObjectManager om,
org.datanucleus.metadata.AbstractClassMetaData acmd)
newStateManager in interface org.datanucleus.api.ApiAdapterom - ObjectManageracmd - MetaData for the class/interfacepublic org.datanucleus.state.LifeCycleState getLifeCycleState(int stateType)
getLifeCycleState in interface org.datanucleus.api.ApiAdapterstateType - the type as integer
public boolean isPersistent(java.lang.Object obj)
isPersistent in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isNew(java.lang.Object obj)
isNew in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isDirty(java.lang.Object obj)
isDirty in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isDeleted(java.lang.Object obj)
isDeleted in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isDetached(java.lang.Object obj)
isDetached in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isTransactional(java.lang.Object obj)
isTransactional in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isPersistable(java.lang.Object obj)
isPersistable in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isPersistable(java.lang.Class cls)
isPersistable in interface org.datanucleus.api.ApiAdaptercls - The class to check
public boolean isDetachable(java.lang.Object obj)
isDetachable in interface org.datanucleus.api.ApiAdapterobj - The object
public java.lang.String getObjectState(java.lang.Object obj)
getObjectState in interface org.datanucleus.api.ApiAdapterobj - Object
public java.lang.Object getIdForObject(java.lang.Object obj)
getIdForObject in interface org.datanucleus.api.ApiAdapterobj - The object
public java.lang.Object getVersionForObject(java.lang.Object obj)
getVersionForObject in interface org.datanucleus.api.ApiAdapterobj - The object
public boolean isValidPrimaryKeyClass(java.lang.Class pkClass,
org.datanucleus.metadata.AbstractClassMetaData cmd,
org.datanucleus.ClassLoaderResolver clr,
int noOfPkFields)
isValidPrimaryKeyClass in interface org.datanucleus.api.ApiAdapterpkClass - The Primary Key classcmd - AbstractClassMetaData for the PersistenceCapable classclr - the ClassLoaderResolvernoOfPkFields - Number of primary key fields
public boolean isSingleFieldIdentity(java.lang.Object id)
isSingleFieldIdentity in interface org.datanucleus.api.ApiAdapterpublic boolean isSingleFieldIdentityClass(java.lang.String className)
isSingleFieldIdentityClass in interface org.datanucleus.api.ApiAdapterclassName - the full class name
public java.lang.String getSingleFieldIdentityClassNameForLong()
getSingleFieldIdentityClassNameForLong in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForInt()
getSingleFieldIdentityClassNameForInt in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForShort()
getSingleFieldIdentityClassNameForShort in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForByte()
getSingleFieldIdentityClassNameForByte in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForChar()
getSingleFieldIdentityClassNameForChar in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForString()
getSingleFieldIdentityClassNameForString in interface org.datanucleus.api.ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForObject()
getSingleFieldIdentityClassNameForObject in interface org.datanucleus.api.ApiAdapterpublic java.lang.Class getTargetClassForSingleFieldIdentity(java.lang.Object id)
getTargetClassForSingleFieldIdentity in interface org.datanucleus.api.ApiAdapterid - The identity
public java.lang.String getTargetClassNameForSingleFieldIdentity(java.lang.Object id)
getTargetClassNameForSingleFieldIdentity in interface org.datanucleus.api.ApiAdapterid - The identity
public java.lang.Object getTargetKeyForSingleFieldIdentity(java.lang.Object id)
getTargetKeyForSingleFieldIdentity in interface org.datanucleus.api.ApiAdapterid - The identity
public java.lang.Class getKeyTypeForSingleFieldIdentityType(java.lang.Class idType)
getKeyTypeForSingleFieldIdentityType in interface org.datanucleus.api.ApiAdapteridType - Single field identity type
public java.lang.Object getNewSingleFieldIdentity(java.lang.Class idType,
java.lang.Class pcType,
java.lang.Object value)
getNewSingleFieldIdentity in interface org.datanucleus.api.ApiAdapteridType - Type of SingleFieldIdentitypcType - Type of the PersistenceCapablevalue - The value for the identity (the Long, or Int, or ... etc).
org.datanucleus.exceptions.NucleusException - if invalid input is received
public java.lang.Object getNewApplicationIdentityObjectId(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.metadata.AbstractClassMetaData acmd,
java.lang.String value)
getNewApplicationIdentityObjectId in interface org.datanucleus.api.ApiAdapterclr - ClassLoader resolveracmd - MetaData for the target classvalue - String form of the key
org.datanucleus.exceptions.NucleusException - if invalid input is received
public java.lang.Object getNewApplicationIdentityObjectId(java.lang.Object pc,
org.datanucleus.metadata.AbstractClassMetaData cmd)
getNewApplicationIdentityObjectId in interface org.datanucleus.api.ApiAdapterpc - The persistable objectcmd - Its metadata
public java.lang.Object getNewApplicationIdentityObjectId(java.lang.Class cls,
java.lang.Object key)
getNewApplicationIdentityObjectId in interface org.datanucleus.api.ApiAdaptercls - Persistable classkey - form of the object id
public boolean allowPersistOfDeletedObject()
allowPersistOfDeletedObject in interface org.datanucleus.api.ApiAdapterpublic boolean allowDeleteOfNonPersistentObject()
allowDeleteOfNonPersistentObject in interface org.datanucleus.api.ApiAdapterpublic boolean allowReadFieldOfDeletedObject()
allowReadFieldOfDeletedObject in interface org.datanucleus.api.ApiAdapterpublic boolean clearLoadedFlagsOnDeleteObject()
clearLoadedFlagsOnDeleteObject in interface org.datanucleus.api.ApiAdapterpublic boolean getDefaultCascadePersistForField()
getDefaultCascadePersistForField in interface org.datanucleus.api.ApiAdapterpublic boolean getDefaultCascadeUpdateForField()
getDefaultCascadeUpdateForField in interface org.datanucleus.api.ApiAdapterpublic boolean getDefaultCascadeDeleteForField()
getDefaultCascadeDeleteForField in interface org.datanucleus.api.ApiAdapterpublic boolean getDefaultCascadeRefreshForField()
getDefaultCascadeRefreshForField in interface org.datanucleus.api.ApiAdapterpublic java.util.Map getDefaultFactoryProperties()
getDefaultFactoryProperties in interface org.datanucleus.api.ApiAdapterpublic java.lang.Object getObjectId(org.datanucleus.StateManager sm)
getObjectId in interface org.datanucleus.api.ApiAdaptersm - StateManager
public java.lang.Object getVersion(org.datanucleus.StateManager sm)
getVersion in interface org.datanucleus.api.ApiAdaptersm - StateManager
public boolean isLoaded(org.datanucleus.StateManager sm,
int fieldNumber)
isLoaded in interface org.datanucleus.api.ApiAdaptersm - StateManagerfieldNumber - Number of the field
public java.lang.Object getPersistenceManager(java.lang.Object obj)
getPersistenceManager in interface org.datanucleus.api.ApiAdapterobj - The object
public void makeFieldDirty(java.lang.Object obj,
java.lang.String fieldName)
makeFieldDirty in interface org.datanucleus.api.ApiAdapterobj - ObjectfieldName - Name of the field to make dirty
public java.lang.RuntimeException getExceptionForException(java.lang.String msg,
java.lang.Exception e)
getExceptionForException in interface org.datanucleus.api.ApiAdaptermsg - The messagee - The cause
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||