|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.jdo.JDOAdapter
public class JDOAdapter
Adapter for the JDO API, to allow the DataNucleus core runtime to expose multiple APIs to clients.
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
|
| Constructor Summary | |
|---|---|
JDOAdapter()
|
|
| 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. |
java.lang.RuntimeException |
getDataStoreExceptionForException(java.lang.String msg,
java.lang.Exception e)
Convenience method to return a datastore exception appropriate for this API. |
boolean |
getDefaultCascadeDeleteForField()
Returns the default cascade-delete setting. |
boolean |
getDefaultCascadePersistForField()
Returns the default cascade-persist. |
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. |
ExecutionContext |
getExecutionContext(java.lang.Object obj)
Method to return the ObjectManager (if any) associated with the passed object. |
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. |
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(ClassLoaderResolver clr,
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,
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(ObjectProvider sm)
Accessor for the object id from the StateManager for this 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.RuntimeException |
getUserExceptionForException(java.lang.String msg,
java.lang.Exception e)
Convenience method to return a user exception appropriate for this API. |
java.lang.Object |
getVersion(ObjectProvider 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 |
isDatastoreIdentity(java.lang.Object id)
Accessor for whether the passed identity is a valid datastore-identity for this API. |
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(ObjectProvider sm,
int fieldNumber)
Accessor for whether a field is loaded for the object managed by the StateManager |
boolean |
isManaged(java.lang.Object pc)
Whether the provided object is currently managed (has an ObjectManager). |
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,
AbstractClassMetaData cmd,
ClassLoaderResolver clr,
int noOfPkFields,
MetaDataManager mmgr)
Utility to check if a primary-key class is valid. |
void |
makeDirty(java.lang.Object obj,
java.lang.String member)
Method to make the member of the persistable object dirty. |
void |
makeFieldDirty(java.lang.Object obj,
java.lang.String fieldName)
Method to make the field dirty in the object. |
StateManager |
newStateManager(ExecutionContext ec,
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 Localiser LOCALISER
| Constructor Detail |
|---|
public JDOAdapter()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface ApiAdapterpublic boolean isManaged(java.lang.Object pc)
isManaged in interface ApiAdapterpublic ExecutionContext getExecutionContext(java.lang.Object obj)
getExecutionContext in interface ApiAdapterobj - The object
public StateManager newStateManager(ExecutionContext ec,
AbstractClassMetaData acmd)
newStateManager in interface ApiAdapterec - ExecutionContextacmd - MetaData for the class/interfacepublic LifeCycleState getLifeCycleState(int stateType)
getLifeCycleState in interface ApiAdapterstateType - the type as integer
public boolean isPersistent(java.lang.Object obj)
isPersistent in interface ApiAdapterobj - The object
public boolean isNew(java.lang.Object obj)
isNew in interface ApiAdapterobj - The object
public boolean isDirty(java.lang.Object obj)
isDirty in interface ApiAdapterobj - The object
public boolean isDeleted(java.lang.Object obj)
isDeleted in interface ApiAdapterobj - The object
public boolean isDetached(java.lang.Object obj)
isDetached in interface ApiAdapterobj - The object
public boolean isTransactional(java.lang.Object obj)
isTransactional in interface ApiAdapterobj - The object
public boolean isPersistable(java.lang.Object obj)
isPersistable in interface ApiAdapterobj - The object
public boolean isPersistable(java.lang.Class cls)
isPersistable in interface ApiAdaptercls - The class to check
public boolean isDetachable(java.lang.Object obj)
isDetachable in interface ApiAdapterobj - The object
public java.lang.String getObjectState(java.lang.Object obj)
getObjectState in interface ApiAdapterobj - Object
public void makeDirty(java.lang.Object obj,
java.lang.String member)
ApiAdapter
makeDirty in interface ApiAdapterobj - The objectmember - Name of the memberpublic java.lang.Object getIdForObject(java.lang.Object obj)
getIdForObject in interface ApiAdapterobj - The object
public java.lang.Object getVersionForObject(java.lang.Object obj)
getVersionForObject in interface ApiAdapterobj - The object
public boolean isValidPrimaryKeyClass(java.lang.Class pkClass,
AbstractClassMetaData cmd,
ClassLoaderResolver clr,
int noOfPkFields,
MetaDataManager mmgr)
isValidPrimaryKeyClass in interface ApiAdapterpkClass - The Primary Key classcmd - AbstractClassMetaData for the PersistenceCapable classclr - the ClassLoaderResolvernoOfPkFields - Number of primary key fieldsmmgr - MetaData manager
public boolean isSingleFieldIdentity(java.lang.Object id)
isSingleFieldIdentity in interface ApiAdapterpublic boolean isDatastoreIdentity(java.lang.Object id)
ApiAdapter
isDatastoreIdentity in interface ApiAdapterpublic boolean isSingleFieldIdentityClass(java.lang.String className)
isSingleFieldIdentityClass in interface ApiAdapterclassName - the full class name
public java.lang.String getSingleFieldIdentityClassNameForLong()
getSingleFieldIdentityClassNameForLong in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForInt()
getSingleFieldIdentityClassNameForInt in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForShort()
getSingleFieldIdentityClassNameForShort in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForByte()
getSingleFieldIdentityClassNameForByte in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForChar()
getSingleFieldIdentityClassNameForChar in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForString()
getSingleFieldIdentityClassNameForString in interface ApiAdapterpublic java.lang.String getSingleFieldIdentityClassNameForObject()
getSingleFieldIdentityClassNameForObject in interface ApiAdapterpublic java.lang.Class getTargetClassForSingleFieldIdentity(java.lang.Object id)
getTargetClassForSingleFieldIdentity in interface ApiAdapterid - The identity
public java.lang.String getTargetClassNameForSingleFieldIdentity(java.lang.Object id)
getTargetClassNameForSingleFieldIdentity in interface ApiAdapterid - The identity
public java.lang.Object getTargetKeyForSingleFieldIdentity(java.lang.Object id)
getTargetKeyForSingleFieldIdentity in interface ApiAdapterid - The identity
public java.lang.Class getKeyTypeForSingleFieldIdentityType(java.lang.Class idType)
getKeyTypeForSingleFieldIdentityType in interface 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 ApiAdapteridType - Type of SingleFieldIdentitypcType - Type of the PersistenceCapablevalue - The value for the identity (the Long, or Int, or ... etc).
NucleusException - if invalid input is received
public java.lang.Object getNewApplicationIdentityObjectId(ClassLoaderResolver clr,
AbstractClassMetaData acmd,
java.lang.String value)
getNewApplicationIdentityObjectId in interface ApiAdapterclr - ClassLoader resolveracmd - MetaData for the target classvalue - String form of the key
NucleusException - if invalid input is received
public java.lang.Object getNewApplicationIdentityObjectId(java.lang.Object pc,
AbstractClassMetaData cmd)
getNewApplicationIdentityObjectId in interface ApiAdapterpc - The persistable objectcmd - Its metadata
public java.lang.Object getNewApplicationIdentityObjectId(java.lang.Class cls,
java.lang.Object key)
getNewApplicationIdentityObjectId in interface ApiAdaptercls - Persistable classkey - form of the object id
public boolean allowPersistOfDeletedObject()
allowPersistOfDeletedObject in interface ApiAdapterpublic boolean allowDeleteOfNonPersistentObject()
allowDeleteOfNonPersistentObject in interface ApiAdapterpublic boolean allowReadFieldOfDeletedObject()
allowReadFieldOfDeletedObject in interface ApiAdapterpublic boolean clearLoadedFlagsOnDeleteObject()
clearLoadedFlagsOnDeleteObject in interface ApiAdapterpublic boolean getDefaultCascadePersistForField()
getDefaultCascadePersistForField in interface ApiAdapterpublic boolean getDefaultCascadeUpdateForField()
getDefaultCascadeUpdateForField in interface ApiAdapterpublic boolean getDefaultCascadeDeleteForField()
getDefaultCascadeDeleteForField in interface ApiAdapterpublic boolean getDefaultCascadeRefreshForField()
getDefaultCascadeRefreshForField in interface ApiAdapterpublic java.util.Map getDefaultFactoryProperties()
getDefaultFactoryProperties in interface ApiAdapterpublic java.lang.Object getObjectId(ObjectProvider sm)
getObjectId in interface ApiAdaptersm - StateManager
public java.lang.Object getVersion(ObjectProvider sm)
getVersion in interface ApiAdaptersm - StateManager
public boolean isLoaded(ObjectProvider sm,
int fieldNumber)
isLoaded in interface ApiAdaptersm - StateManagerfieldNumber - Number of the field
public java.lang.Object getPersistenceManager(java.lang.Object obj)
getPersistenceManager in interface ApiAdapterobj - The object
public void makeFieldDirty(java.lang.Object obj,
java.lang.String fieldName)
makeFieldDirty in interface ApiAdapterobj - ObjectfieldName - Name of the field to make dirty
public java.lang.RuntimeException getUserExceptionForException(java.lang.String msg,
java.lang.Exception e)
getUserExceptionForException in interface ApiAdaptermsg - The messagee - The cause
public java.lang.RuntimeException getDataStoreExceptionForException(java.lang.String msg,
java.lang.Exception e)
getDataStoreExceptionForException in interface ApiAdaptermsg - The messagee - Any root cause exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||