public interface ApiAdapter extends Serializable
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.
|
default void |
copyKeyFieldsFromIdToObject(Object pc,
Persistable.ObjectIdFieldConsumer fm,
Object id)
Method to set the pk fields of the object from the provided identity.
|
RuntimeException |
getApiExceptionForNucleusException(NucleusException ne)
Convenience method to convert the passed NucleusException into an exception for the API.
|
RuntimeException |
getDataStoreExceptionForException(String msg,
Exception e)
Convenience method to return a datastore exception appropriate for this API.
|
boolean |
getDefaultCascadeDeleteForField()
Method to return the default setting for cascading delete of a field
|
boolean |
getDefaultCascadeDetachForField()
Method to return the default setting for cascading detach of a field
|
boolean |
getDefaultCascadePersistForField()
Method to return the default setting for cascading persist of a field
|
boolean |
getDefaultCascadeRefreshForField()
Method to return the default setting for cascading refresh of a field
|
boolean |
getDefaultCascadeUpdateForField()
Method to return the default setting for cascading update of a field
|
boolean |
getDefaultDFGForPersistableField()
Method to return the default DFG setting for a persistable field.
|
Map |
getDefaultFactoryProperties()
Method to return a set of default properties for the factory (PMF, EMF, etc)
|
ExecutionContext |
getExecutionContext(Object pc)
Method to return the ExecutionContext (if any) associated with the passed object.
|
default Object |
getIdForObject(Object obj)
Method to return the object identity for the passed persistable object.
|
LifeCycleState |
getLifeCycleState(int stateType)
Returns the LifeCycleState for the state constant.
|
String |
getName()
Accessor for the name of the API.
|
String |
getObjectState(Object obj)
Accessor for the object state.
|
default StateManager |
getStateManager(Object pc)
Accessor for the state manager for the object.
|
RuntimeException |
getUserExceptionForException(String msg,
Exception e)
Convenience method to return a user exception appropriate for this API when an unexpected
exception occurs.
|
default Object |
getVersionForObject(Object obj)
Method to return the object version for the passed persistable object.
|
default boolean |
isDeleted(Object obj)
Accessor for whether the passed object is deleted.
|
default boolean |
isDetachable(Object obj)
Method to return if the passed object is detachable using this API.
|
default boolean |
isDetached(Object obj)
Accessor for whether the passed object is detached.
|
default boolean |
isDirty(Object obj)
Accessor for whether the passed object is dirty.
|
default boolean |
isManaged(Object pc)
Whether the provided object is currently managed (has an ExecutionContext).
|
boolean |
isMemberDefaultPersistent(Class type)
Accessor for whether this member type is default persistent.
|
default boolean |
isNew(Object obj)
Accessor for whether the passed object is new.
|
default boolean |
isPersistable(Class cls)
Utility method to check if the specified class is of a type that can be persisted for this API.
|
default boolean |
isPersistable(Object obj)
Method to return if the passed object is persistable using this API.
|
default boolean |
isPersistent(Object obj)
Accessor for whether the passed object is persistent.
|
default boolean |
isTransactional(Object obj)
Accessor for whether the passed object is transactional.
|
boolean |
isValidPrimaryKeyClass(Class pkClass,
AbstractClassMetaData cmd,
ClassLoaderResolver clr,
int noOfPkFields,
MetaDataManager mmgr)
Utility to check if a primary-key class is valid.
|
default void |
makeDirty(Object obj,
String member)
Method to make the member of the persistable object dirty.
|
String getName()
boolean isMemberDefaultPersistent(Class type)
type
- Member typedefault boolean isManaged(Object pc)
pc
- The persistable objectdefault StateManager getStateManager(Object pc)
pc
- The objectExecutionContext getExecutionContext(Object pc)
pc
- The objectLifeCycleState getLifeCycleState(int stateType)
stateType
- the type as integerdefault boolean isPersistent(Object obj)
obj
- The objectdefault boolean isNew(Object obj)
obj
- The objectdefault boolean isDirty(Object obj)
obj
- The objectdefault boolean isDeleted(Object obj)
obj
- The objectdefault boolean isDetached(Object obj)
obj
- The objectdefault boolean isTransactional(Object obj)
obj
- The objectdefault boolean isPersistable(Object obj)
obj
- The objectdefault boolean isPersistable(Class cls)
cls
- The class to checkdefault boolean isDetachable(Object obj)
obj
- The objectString getObjectState(Object obj)
obj
- Objectdefault void makeDirty(Object obj, String member)
obj
- The objectmember
- Name of the memberdefault Object getIdForObject(Object obj)
obj
- The objectdefault Object getVersionForObject(Object obj)
obj
- The objectboolean isValidPrimaryKeyClass(Class pkClass, AbstractClassMetaData cmd, ClassLoaderResolver clr, int noOfPkFields, MetaDataManager mmgr)
pkClass
- The Primary Key classcmd
- AbstractClassMetaData for the persistable classclr
- the ClassLoaderResolvernoOfPkFields
- Number of primary key fieldsmmgr
- MetaData managerdefault void copyKeyFieldsFromIdToObject(Object pc, Persistable.ObjectIdFieldConsumer fm, Object id)
pc
- The persistable objectfm
- ObjectIdFieldConsumerid
- The identityboolean allowPersistOfDeletedObject()
boolean allowDeleteOfNonPersistentObject()
boolean allowReadFieldOfDeletedObject()
boolean clearLoadedFlagsOnDeleteObject()
boolean getDefaultCascadePersistForField()
boolean getDefaultCascadeUpdateForField()
boolean getDefaultCascadeDeleteForField()
boolean getDefaultCascadeDetachForField()
boolean getDefaultCascadeRefreshForField()
boolean getDefaultDFGForPersistableField()
Map getDefaultFactoryProperties()
RuntimeException getApiExceptionForNucleusException(NucleusException ne)
ne
- The NucleusExceptionRuntimeException getUserExceptionForException(String msg, Exception e)
msg
- The messagee
- The cause (if any)RuntimeException getDataStoreExceptionForException(String msg, Exception e)
msg
- The messagee
- The cause (if any)Copyright © 2019. All rights reserved.