public class JPAAdapter extends Object implements org.datanucleus.api.ApiAdapter
| Modifier and Type | Field and Description |
|---|---|
protected static Set<String> |
defaultPersistentTypeNames |
| Constructor and Description |
|---|
JPAAdapter() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
copyKeyFieldsFromIdToObject(Object pc,
org.datanucleus.enhancer.Persistable.ObjectIdFieldConsumer fm,
Object id) |
RuntimeException |
getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne) |
RuntimeException |
getDataStoreExceptionForException(String msg,
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 setting.
|
boolean |
getDefaultCascadeRefreshForField()
Returns the default cascade-refresh setting.
|
boolean |
getDefaultCascadeUpdateForField()
Returns the default cascade-update setting.
|
boolean |
getDefaultDFGForPersistableField() |
Map |
getDefaultFactoryProperties()
Method to return the default factory properties for this API.
|
org.datanucleus.ExecutionContext |
getExecutionContext(Object obj)
Method to return the ExecutionContext (if any) associated with the passed object.
|
Object |
getIdForObject(Object obj)
Method to return the object identity for the passed persistable object.
|
org.datanucleus.state.LifeCycleState |
getLifeCycleState(int stateType)
Returns the LifeCycleState for the state constant.
|
String |
getName()
Accessor for the name of the API.
|
String |
getObjectState(Object pc)
Accessor for the object state.
|
RuntimeException |
getUserExceptionForException(String msg,
Exception e)
Convenience method to return an exception to throw for this API when an unexpected
exception occurs.
|
Object |
getVersionForObject(Object obj)
Method to return the object version for the passed persistable object.
|
boolean |
isDeleted(Object obj)
Accessor for whether the passed object is deleted.
|
boolean |
isDetachable(Object obj)
Method to return if the passed object is detachable using this API.
|
boolean |
isDetached(Object obj)
Accessor for whether the passed object is detached.
|
boolean |
isDirty(Object obj)
Accessor for whether the passed object is dirty.
|
boolean |
isManaged(Object pc)
Whether the provided object is currently managed (has an ExecutionContext).
|
boolean |
isMemberDefaultPersistent(Class type) |
boolean |
isNew(Object obj)
Accessor for whether the passed object is new.
|
boolean |
isPersistable(Class cls)
Utility method to check if the specified class is of a type that can be persisted for this API.
|
boolean |
isPersistable(Object obj)
Method to return if the passed object is persistable using this API.
|
boolean |
isPersistent(Object obj)
Accessor for whether the passed object is persistent.
|
boolean |
isTransactional(Object obj)
Accessor for whether the passed object is transactional.
|
boolean |
isValidPrimaryKeyClass(Class pkClass,
org.datanucleus.metadata.AbstractClassMetaData cmd,
org.datanucleus.ClassLoaderResolver clr,
int noOfPkFields,
org.datanucleus.metadata.MetaDataManager mmgr)
Utility to check if a primary-key class is valid.
|
void |
makeDirty(Object obj,
String member) |
public String getName()
getName in interface org.datanucleus.api.ApiAdapterpublic boolean isMemberDefaultPersistent(Class type)
isMemberDefaultPersistent in interface org.datanucleus.api.ApiAdapterpublic boolean isManaged(Object pc)
isManaged in interface org.datanucleus.api.ApiAdapterpublic org.datanucleus.ExecutionContext getExecutionContext(Object obj)
getExecutionContext in interface org.datanucleus.api.ApiAdapterobj - The objectpublic org.datanucleus.state.LifeCycleState getLifeCycleState(int stateType)
getLifeCycleState in interface org.datanucleus.api.ApiAdapterstateType - the type as integerpublic boolean isPersistent(Object obj)
isPersistent in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isNew(Object obj)
isNew in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isDirty(Object obj)
isDirty in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isDeleted(Object obj)
isDeleted in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isDetached(Object obj)
isDetached in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isTransactional(Object obj)
isTransactional in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isPersistable(Object obj)
isPersistable in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isPersistable(Class cls)
isPersistable in interface org.datanucleus.api.ApiAdaptercls - The class to checkpublic boolean isDetachable(Object obj)
isDetachable in interface org.datanucleus.api.ApiAdapterobj - The objectpublic String getObjectState(Object pc)
getObjectState in interface org.datanucleus.api.ApiAdapterpc - Objectpublic void makeDirty(Object obj, String member)
makeDirty in interface org.datanucleus.api.ApiAdapterpublic Object getIdForObject(Object obj)
getIdForObject in interface org.datanucleus.api.ApiAdapterobj - The objectpublic Object getVersionForObject(Object obj)
getVersionForObject in interface org.datanucleus.api.ApiAdapterobj - The objectpublic boolean isValidPrimaryKeyClass(Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, int noOfPkFields, org.datanucleus.metadata.MetaDataManager mmgr)
isValidPrimaryKeyClass in interface org.datanucleus.api.ApiAdapterpkClass - The Primary Key classcmd - AbstractClassMetaData for the Persistable classclr - the ClassLoaderResolvernoOfPkFields - Number of primary key fieldsmmgr - MetaData managerpublic 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 boolean getDefaultDFGForPersistableField()
getDefaultDFGForPersistableField in interface org.datanucleus.api.ApiAdapterpublic Map getDefaultFactoryProperties()
getDefaultFactoryProperties in interface org.datanucleus.api.ApiAdapterpublic RuntimeException getUserExceptionForException(String msg, Exception e)
getUserExceptionForException in interface org.datanucleus.api.ApiAdaptermsg - The messagee - The causepublic RuntimeException getDataStoreExceptionForException(String msg, Exception e)
getDataStoreExceptionForException in interface org.datanucleus.api.ApiAdaptermsg - The messagee - Any root cause exceptionpublic RuntimeException getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
getApiExceptionForNucleusException in interface org.datanucleus.api.ApiAdapterCopyright © 2015. All rights reserved.