Class JDOAdapter

java.lang.Object
org.datanucleus.api.jdo.JDOAdapter
All Implemented Interfaces:
Serializable, org.datanucleus.api.ApiAdapter

public class JDOAdapter extends 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • defaultPersistentTypeNames

      protected static final Set<String> defaultPersistentTypeNames
  • Constructor Details

    • JDOAdapter

      public JDOAdapter()
  • Method Details

    • getName

      public String getName()
      Accessor for the name of the API.
      Specified by:
      getName in interface org.datanucleus.api.ApiAdapter
      Returns:
      Name of the API
    • isMemberDefaultPersistent

      public boolean isMemberDefaultPersistent(Class type)
      Specified by:
      isMemberDefaultPersistent in interface org.datanucleus.api.ApiAdapter
    • getXMLMetaDataForClass

      public String getXMLMetaDataForClass(org.datanucleus.metadata.AbstractClassMetaData cmd, String prefix, String indent)
      Specified by:
      getXMLMetaDataForClass in interface org.datanucleus.api.ApiAdapter
    • getDefaultMappingFileLocation

      public String getDefaultMappingFileLocation()
      Specified by:
      getDefaultMappingFileLocation in interface org.datanucleus.api.ApiAdapter
    • getExecutionContext

      public org.datanucleus.ExecutionContext getExecutionContext(Object obj)
      Specified by:
      getExecutionContext in interface org.datanucleus.api.ApiAdapter
    • getLifeCycleState

      public org.datanucleus.state.LifeCycleState getLifeCycleState(int stateType)
      Specified by:
      getLifeCycleState in interface org.datanucleus.api.ApiAdapter
    • getObjectState

      public String getObjectState(Object obj)
      Specified by:
      getObjectState in interface org.datanucleus.api.ApiAdapter
    • isValidPrimaryKeyClass

      public boolean isValidPrimaryKeyClass(Class pkClass, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr, int noOfPkFields, org.datanucleus.metadata.MetaDataManager mmgr)
      Specified by:
      isValidPrimaryKeyClass in interface org.datanucleus.api.ApiAdapter
    • processPrimaryKeyClass

      private int processPrimaryKeyClass(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 for
      mmgr - MetaData manager
      Returns:
      The number of PK fields
    • allowPersistOfDeletedObject

      public boolean allowPersistOfDeletedObject()
      Specified by:
      allowPersistOfDeletedObject in interface org.datanucleus.api.ApiAdapter
    • allowDeleteOfNonPersistentObject

      public boolean allowDeleteOfNonPersistentObject()
      Specified by:
      allowDeleteOfNonPersistentObject in interface org.datanucleus.api.ApiAdapter
    • allowReadFieldOfDeletedObject

      public boolean allowReadFieldOfDeletedObject()
      Specified by:
      allowReadFieldOfDeletedObject in interface org.datanucleus.api.ApiAdapter
    • clearLoadedFlagsOnDeleteObject

      public boolean clearLoadedFlagsOnDeleteObject()
      Specified by:
      clearLoadedFlagsOnDeleteObject in interface org.datanucleus.api.ApiAdapter
    • getDefaultCascadePersistForField

      public boolean getDefaultCascadePersistForField()
      Specified by:
      getDefaultCascadePersistForField in interface org.datanucleus.api.ApiAdapter
    • getDefaultCascadeAttachForField

      public boolean getDefaultCascadeAttachForField()
      Specified by:
      getDefaultCascadeAttachForField in interface org.datanucleus.api.ApiAdapter
    • getDefaultCascadeDeleteForField

      public boolean getDefaultCascadeDeleteForField()
      Specified by:
      getDefaultCascadeDeleteForField in interface org.datanucleus.api.ApiAdapter
    • getDefaultCascadeDetachForField

      public boolean getDefaultCascadeDetachForField()
      Specified by:
      getDefaultCascadeDetachForField in interface org.datanucleus.api.ApiAdapter
    • getDefaultCascadeRefreshForField

      public boolean getDefaultCascadeRefreshForField()
      Specified by:
      getDefaultCascadeRefreshForField in interface org.datanucleus.api.ApiAdapter
    • getDefaultDFGForPersistableField

      public boolean getDefaultDFGForPersistableField()
      Specified by:
      getDefaultDFGForPersistableField in interface org.datanucleus.api.ApiAdapter
    • getDefaultFactoryProperties

      public Map<String,Object> getDefaultFactoryProperties()
      Specified by:
      getDefaultFactoryProperties in interface org.datanucleus.api.ApiAdapter
    • getDefaultPersistentPropertyWhenNotSpecified

      public boolean getDefaultPersistentPropertyWhenNotSpecified()
      Specified by:
      getDefaultPersistentPropertyWhenNotSpecified in interface org.datanucleus.api.ApiAdapter
    • getUserExceptionForException

      public RuntimeException getUserExceptionForException(String msg, Exception e)
      Specified by:
      getUserExceptionForException in interface org.datanucleus.api.ApiAdapter
    • getDataStoreExceptionForException

      public RuntimeException getDataStoreExceptionForException(String msg, Exception e)
      Specified by:
      getDataStoreExceptionForException in interface org.datanucleus.api.ApiAdapter
    • getApiExceptionForNucleusException

      public RuntimeException getApiExceptionForNucleusException(org.datanucleus.exceptions.NucleusException ne)
      Specified by:
      getApiExceptionForNucleusException in interface org.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