Package org.datanucleus.api.jdo
Class JDOAdapter
- java.lang.Object
-
- org.datanucleus.api.jdo.JDOAdapter
-
- All Implemented Interfaces:
java.io.Serializable
,org.datanucleus.api.ApiAdapter
public class JDOAdapter extends java.lang.Object implements org.datanucleus.api.ApiAdapter
Adapter for the JDO API, to allow the DataNucleus core runtime to expose multiple APIs to clients.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Set<java.lang.String>
defaultPersistentTypeNames
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description JDOAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowDeleteOfNonPersistentObject()
boolean
allowPersistOfDeletedObject()
boolean
allowReadFieldOfDeletedObject()
boolean
clearLoadedFlagsOnDeleteObject()
java.lang.RuntimeException
getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
java.lang.RuntimeException
getDataStoreExceptionForException(java.lang.String msg, java.lang.Exception e)
boolean
getDefaultCascadeAttachForField()
boolean
getDefaultCascadeDeleteForField()
boolean
getDefaultCascadeDetachForField()
boolean
getDefaultCascadePersistForField()
boolean
getDefaultCascadeRefreshForField()
boolean
getDefaultDFGForPersistableField()
java.util.Map<java.lang.String,java.lang.Object>
getDefaultFactoryProperties()
java.lang.String
getDefaultMappingFileLocation()
boolean
getDefaultPersistentPropertyWhenNotSpecified()
org.datanucleus.ExecutionContext
getExecutionContext(java.lang.Object obj)
static javax.jdo.JDOException
getJDOExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
Convenience method to convert an exception into a JDO exception.org.datanucleus.state.LifeCycleState
getLifeCycleState(int stateType)
java.lang.String
getName()
Accessor for the name of the API.java.lang.String
getObjectState(java.lang.Object obj)
java.lang.RuntimeException
getUserExceptionForException(java.lang.String msg, java.lang.Exception e)
java.lang.String
getXMLMetaDataForClass(org.datanucleus.metadata.AbstractClassMetaData cmd, java.lang.String prefix, java.lang.String indent)
boolean
isMemberDefaultPersistent(java.lang.Class type)
boolean
isValidPrimaryKeyClass(java.lang.Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, int noOfPkFields, org.datanucleus.metadata.MetaDataManager mmgr)
private int
processPrimaryKeyClass(java.lang.Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.MetaDataManager mmgr)
Convenience method to process a PK class and return the number of valid fields found.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
defaultPersistentTypeNames
protected static final java.util.Set<java.lang.String> defaultPersistentTypeNames
-
-
Method Detail
-
getName
public java.lang.String getName()
Accessor for the name of the API.- Specified by:
getName
in interfaceorg.datanucleus.api.ApiAdapter
- Returns:
- Name of the API
-
isMemberDefaultPersistent
public boolean isMemberDefaultPersistent(java.lang.Class type)
- Specified by:
isMemberDefaultPersistent
in interfaceorg.datanucleus.api.ApiAdapter
-
getXMLMetaDataForClass
public java.lang.String getXMLMetaDataForClass(org.datanucleus.metadata.AbstractClassMetaData cmd, java.lang.String prefix, java.lang.String indent)
- Specified by:
getXMLMetaDataForClass
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultMappingFileLocation
public java.lang.String getDefaultMappingFileLocation()
- Specified by:
getDefaultMappingFileLocation
in interfaceorg.datanucleus.api.ApiAdapter
-
getExecutionContext
public org.datanucleus.ExecutionContext getExecutionContext(java.lang.Object obj)
- Specified by:
getExecutionContext
in interfaceorg.datanucleus.api.ApiAdapter
-
getLifeCycleState
public org.datanucleus.state.LifeCycleState getLifeCycleState(int stateType)
- Specified by:
getLifeCycleState
in interfaceorg.datanucleus.api.ApiAdapter
-
getObjectState
public java.lang.String getObjectState(java.lang.Object obj)
- Specified by:
getObjectState
in interfaceorg.datanucleus.api.ApiAdapter
-
isValidPrimaryKeyClass
public boolean isValidPrimaryKeyClass(java.lang.Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, int noOfPkFields, org.datanucleus.metadata.MetaDataManager mmgr)
- Specified by:
isValidPrimaryKeyClass
in interfaceorg.datanucleus.api.ApiAdapter
-
processPrimaryKeyClass
private int processPrimaryKeyClass(java.lang.Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.MetaDataManager mmgr)
Convenience method to process a PK class and return the number of valid fields found. Throws InvalidPrimaryKeyException if a field is invalid- Parameters:
pkClass
- The PK class.cmd
- MetaData for the class that this is the PK formmgr
- MetaData manager- Returns:
- The number of PK fields
-
allowPersistOfDeletedObject
public boolean allowPersistOfDeletedObject()
- Specified by:
allowPersistOfDeletedObject
in interfaceorg.datanucleus.api.ApiAdapter
-
allowDeleteOfNonPersistentObject
public boolean allowDeleteOfNonPersistentObject()
- Specified by:
allowDeleteOfNonPersistentObject
in interfaceorg.datanucleus.api.ApiAdapter
-
allowReadFieldOfDeletedObject
public boolean allowReadFieldOfDeletedObject()
- Specified by:
allowReadFieldOfDeletedObject
in interfaceorg.datanucleus.api.ApiAdapter
-
clearLoadedFlagsOnDeleteObject
public boolean clearLoadedFlagsOnDeleteObject()
- Specified by:
clearLoadedFlagsOnDeleteObject
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultCascadePersistForField
public boolean getDefaultCascadePersistForField()
- Specified by:
getDefaultCascadePersistForField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultCascadeAttachForField
public boolean getDefaultCascadeAttachForField()
- Specified by:
getDefaultCascadeAttachForField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultCascadeDeleteForField
public boolean getDefaultCascadeDeleteForField()
- Specified by:
getDefaultCascadeDeleteForField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultCascadeDetachForField
public boolean getDefaultCascadeDetachForField()
- Specified by:
getDefaultCascadeDetachForField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultCascadeRefreshForField
public boolean getDefaultCascadeRefreshForField()
- Specified by:
getDefaultCascadeRefreshForField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultDFGForPersistableField
public boolean getDefaultDFGForPersistableField()
- Specified by:
getDefaultDFGForPersistableField
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultFactoryProperties
public java.util.Map<java.lang.String,java.lang.Object> getDefaultFactoryProperties()
- Specified by:
getDefaultFactoryProperties
in interfaceorg.datanucleus.api.ApiAdapter
-
getDefaultPersistentPropertyWhenNotSpecified
public boolean getDefaultPersistentPropertyWhenNotSpecified()
- Specified by:
getDefaultPersistentPropertyWhenNotSpecified
in interfaceorg.datanucleus.api.ApiAdapter
-
getUserExceptionForException
public java.lang.RuntimeException getUserExceptionForException(java.lang.String msg, java.lang.Exception e)
- Specified by:
getUserExceptionForException
in interfaceorg.datanucleus.api.ApiAdapter
-
getDataStoreExceptionForException
public java.lang.RuntimeException getDataStoreExceptionForException(java.lang.String msg, java.lang.Exception e)
- Specified by:
getDataStoreExceptionForException
in interfaceorg.datanucleus.api.ApiAdapter
-
getApiExceptionForNucleusException
public java.lang.RuntimeException getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
- Specified by:
getApiExceptionForNucleusException
in interfaceorg.datanucleus.api.ApiAdapter
-
getJDOExceptionForNucleusException
public static javax.jdo.JDOException getJDOExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
Convenience method to convert an exception into a JDO exception. If the incoming exception has a "failed object" then create the new exception with a failed object. Otherwise if the incoming exception has nested exceptions then create this exception with those nested exceptions. Else create this exception with the incoming exception as its nested exception.- Parameters:
ne
- NucleusException- Returns:
- The JDOException
-
-