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.ApiAdapter
public boolean isMemberDefaultPersistent(Class type)
isMemberDefaultPersistent
in interface org.datanucleus.api.ApiAdapter
public boolean isManaged(Object pc)
isManaged
in interface org.datanucleus.api.ApiAdapter
public org.datanucleus.ExecutionContext getExecutionContext(Object obj)
getExecutionContext
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic org.datanucleus.state.LifeCycleState getLifeCycleState(int stateType)
getLifeCycleState
in interface org.datanucleus.api.ApiAdapter
stateType
- the type as integerpublic boolean isPersistent(Object obj)
isPersistent
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isNew(Object obj)
isNew
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isDirty(Object obj)
isDirty
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isDeleted(Object obj)
isDeleted
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isDetached(Object obj)
isDetached
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isTransactional(Object obj)
isTransactional
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isPersistable(Object obj)
isPersistable
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic boolean isPersistable(Class cls)
isPersistable
in interface org.datanucleus.api.ApiAdapter
cls
- The class to checkpublic boolean isDetachable(Object obj)
isDetachable
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic String getObjectState(Object pc)
getObjectState
in interface org.datanucleus.api.ApiAdapter
pc
- Objectpublic void makeDirty(Object obj, String member)
makeDirty
in interface org.datanucleus.api.ApiAdapter
public Object getIdForObject(Object obj)
getIdForObject
in interface org.datanucleus.api.ApiAdapter
obj
- The objectpublic Object getVersionForObject(Object obj)
getVersionForObject
in interface org.datanucleus.api.ApiAdapter
obj
- 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.ApiAdapter
pkClass
- 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.ApiAdapter
public boolean allowDeleteOfNonPersistentObject()
allowDeleteOfNonPersistentObject
in interface org.datanucleus.api.ApiAdapter
public boolean allowReadFieldOfDeletedObject()
allowReadFieldOfDeletedObject
in interface org.datanucleus.api.ApiAdapter
public boolean clearLoadedFlagsOnDeleteObject()
clearLoadedFlagsOnDeleteObject
in interface org.datanucleus.api.ApiAdapter
public boolean getDefaultCascadePersistForField()
getDefaultCascadePersistForField
in interface org.datanucleus.api.ApiAdapter
public boolean getDefaultCascadeUpdateForField()
getDefaultCascadeUpdateForField
in interface org.datanucleus.api.ApiAdapter
public boolean getDefaultCascadeDeleteForField()
getDefaultCascadeDeleteForField
in interface org.datanucleus.api.ApiAdapter
public boolean getDefaultCascadeRefreshForField()
getDefaultCascadeRefreshForField
in interface org.datanucleus.api.ApiAdapter
public boolean getDefaultDFGForPersistableField()
getDefaultDFGForPersistableField
in interface org.datanucleus.api.ApiAdapter
public Map getDefaultFactoryProperties()
getDefaultFactoryProperties
in interface org.datanucleus.api.ApiAdapter
public RuntimeException getUserExceptionForException(String msg, Exception e)
getUserExceptionForException
in interface org.datanucleus.api.ApiAdapter
msg
- The messagee
- The causepublic RuntimeException getDataStoreExceptionForException(String msg, Exception e)
getDataStoreExceptionForException
in interface org.datanucleus.api.ApiAdapter
msg
- The messagee
- Any root cause exceptionpublic RuntimeException getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
getApiExceptionForNucleusException
in interface org.datanucleus.api.ApiAdapter
Copyright © 2015. All rights reserved.