Class RDBMSStoreManager

java.lang.Object
org.datanucleus.properties.PropertyStore
org.datanucleus.store.AbstractStoreManager
org.datanucleus.store.rdbms.RDBMSStoreManager
All Implemented Interfaces:
org.datanucleus.store.BackedSCOStoreManager, org.datanucleus.store.schema.SchemaAwareStoreManager, org.datanucleus.store.schema.SchemaScriptAwareStoreManager, org.datanucleus.store.StoreManager

public class RDBMSStoreManager extends org.datanucleus.store.AbstractStoreManager implements org.datanucleus.store.BackedSCOStoreManager, org.datanucleus.store.schema.SchemaAwareStoreManager, org.datanucleus.store.schema.SchemaScriptAwareStoreManager
StoreManager for RDBMS datastores. Provided by the "store-manager" extension key "rdbms" and accepts datastore URLs valid for JDBC.

The RDBMS manager's responsibilities extend those for StoreManager to add :

  • creates and controls access to the data sources required for this datastore instance
  • implements insert(), fetch(), update(), delete() in the interface to StateManager.
  • Providing cached access to JDBC database metadata (in particular column information).
  • Resolving SQL identifier macros to actual SQL identifiers.
TODO Change RDBMSManager to share schema information (DatabaseMetaData) with other RDBMSManager.
  • Field Details

    • METADATA_NONDURABLE_REQUIRES_TABLE

      public static final String METADATA_NONDURABLE_REQUIRES_TABLE
      See Also:
    • dba

      protected DatastoreAdapter dba
      Adapter for the datastore being used.
    • identifierFactory

      protected IdentifierFactory identifierFactory
      Factory for identifiers for this datastore.
    • catalogName

      protected String catalogName
      Default catalog name for the datastore.
    • schemaName

      protected String schemaName
      Default schema name for the datastore.
    • mappingManager

      protected MappingManager mappingManager
      Manager for the mapping between Java and datastore types.
    • insertedDatastoreClassByStateManager

      protected Map<org.datanucleus.state.DNStateManager,DatastoreClass> insertedDatastoreClassByStateManager
      Map of DatastoreClass keyed by StateManager, for objects currently being inserted. Defines to what level an object is inserted in the datastore.
    • schemaLock

      protected ReadWriteLock schemaLock
      Lock object aimed at providing a lock on the schema definition managed here, preventing reads while it is being updated etc.
    • sqlController

      private SQLController sqlController
      Controller for SQL executed on this store.
    • expressionFactory

      protected SQLExpressionFactory expressionFactory
      Factory for expressions using the generic query SQL mechanism.
    • dateTimezoneCalendar

      private transient Calendar dateTimezoneCalendar
      Calendar for this datastore.
    • classAdder

      private RDBMSStoreManager.ClassAdder classAdder
      The active class adder transaction, if any. Some RDBMSManager methods are called recursively in the course of adding new classes. This field allows such methods to coordinate with the active ClassAdder transaction. Write access is controlled via the "lock" object.
    • ddlWriter

      private Writer ddlWriter
      Writer for use when this RDBMSManager is configured to write DDL.
    • completeDDL

      private boolean completeDDL
      Flag for when generating schema as DDL and wanting complete DDL (as opposed to upgrade DDL).
    • writtenDdlStatements

      private Set<String> writtenDdlStatements
      DDL statements already written when in DDL mode. Used to eliminate dupe statements from bidir relations.
    • schemaCallbacks

      private Map<String,Collection<org.datanucleus.metadata.AbstractMemberMetaData>> schemaCallbacks
      State variable for schema generation of the callback information to be processed. TODO Move to ClassTable.
    • backingStoreByMemberName

      private Map<String,org.datanucleus.store.types.scostore.Store> backingStoreByMemberName
    • performingDeleteSchemaForClasses

      boolean performingDeleteSchemaForClasses
  • Constructor Details

    • RDBMSStoreManager

      public RDBMSStoreManager(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.PersistenceNucleusContext ctx, Map<String,Object> props)
      Constructs a new RDBMSManager. On successful return the new RDBMSManager will have successfully connected to the database with the given credentials and determined the schema name, but will not have inspected the schema contents any further. The contents (tables, views, etc.) will be subsequently created and/or validated on-demand as the application accesses persistent classes.
      Parameters:
      clr - the ClassLoaderResolver
      ctx - The corresponding Context. This factory's non-tx data source will be used to get database connections as needed to perform management functions.
      props - Properties for the datastore
      Throws:
      org.datanucleus.exceptions.NucleusDataStoreException - If the database could not be accessed or the name of the schema could not be determined.
  • Method Details

    • getQueryCacheKey

      public String getQueryCacheKey()
      Specified by:
      getQueryCacheKey in interface org.datanucleus.store.StoreManager
    • initialiseIdentifierFactory

      protected void initialiseIdentifierFactory(org.datanucleus.NucleusContext nucleusContext)
      Method to create the IdentifierFactory to be used by this store. Relies on the datastore adapter existing before creation
      Parameters:
      nucleusContext - context
    • getIdentifierFactory

      public IdentifierFactory getIdentifierFactory()
      Accessor for the factory for creating identifiers (table/column names etc).
      Returns:
      Identifier factory
    • getDatastoreAdapter

      public DatastoreAdapter getDatastoreAdapter()
      Gets the DatastoreAdapter to use for this store.
      Returns:
      Returns the DatastoreAdapter
    • getMappingManager

      public MappingManager getMappingManager()
      Gets the MappingManager to use for this store.
      Returns:
      Returns the MappingManager.
    • getDefaultStateManagerClassName

      public String getDefaultStateManagerClassName()
      Specified by:
      getDefaultStateManagerClassName in interface org.datanucleus.store.StoreManager
      Overrides:
      getDefaultStateManagerClassName in class org.datanucleus.store.AbstractStoreManager
    • getStoreDataForDatastoreContainerObject

      public org.datanucleus.store.StoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
      Utility to return all StoreData for a Datastore Container identifier. Returns StoreData with this table identifier and where the class is the owner of the table.
      Parameters:
      tableIdentifier - Identifier for the table
      Returns:
      The StoreData for this table (if managed).
    • getTable

      public Table getTable(org.datanucleus.metadata.AbstractMemberMetaData mmd)
      Returns the datastore container (table) for the specified field. Returns 'null' if the field is not (yet) known to the store manager. Note : if we have an embedded object (embedded into something else) that has a member which requires a join table, then this method will not cater for having different tables for the different places that the object can be embedded.
      Parameters:
      mmd - The metadata for the field.
      Returns:
      The corresponding datastore container, or 'null'.
    • getDatastoreClass

      public DatastoreClass getDatastoreClass(String className, org.datanucleus.ClassLoaderResolver clr)
      Returns the primary datastore table serving as backing for the given class. If the class is not yet known to the store manager, manageClasses(org.datanucleus.ClassLoaderResolver, java.lang.String...) is called to add it. Classes which have inheritance strategy of "new-table" and "superclass-table" will return a table here, whereas "subclass-table" will return null since it doesn't have a table as such.

      Parameters:
      className - Name of the class whose table is be returned.
      clr - The ClassLoaderResolver
      Returns:
      The corresponding class table.
      Throws:
      NoTableManagedException - If the given class has no table managed in the database.
    • getDatastoreClass

      public DatastoreClass getDatastoreClass(DatastoreIdentifier name)
      Returns the datastore table having the given identifier. Returns 'null' if no such table is (yet) known to the store manager.
      Parameters:
      name - The identifier name of the table.
      Returns:
      The corresponding table, or 'null'
    • getClassesManagingTableForClass

      public org.datanucleus.metadata.AbstractClassMetaData[] getClassesManagingTableForClass(org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr)
      Method to return the class(es) that has a table managing the persistence of the fields of the supplied class. For the 3 inheritance strategies, the following occurs :-
      • new-table : will return the same ClassMetaData
      • subclass-table : will return all subclasses that have a table managing its fields
      • superclass-table : will return the next superclass that has a table
      Parameters:
      cmd - The supplied class.
      clr - ClassLoader resolver
      Returns:
      The ClassMetaData's managing the fields of the supplied class
    • isObjectInserted

      public boolean isObjectInserted(org.datanucleus.state.DNStateManager sm, int fieldNumber)
      Accessor for whether the specified field of the object is inserted in the datastore yet.
      Parameters:
      sm - StateManager for the object
      fieldNumber - (Absolute) field number for the object
      Returns:
      Whether it is persistent
    • isObjectInserted

      public boolean isObjectInserted(org.datanucleus.state.DNStateManager sm, String className)
      Returns whether this object is inserted in the datastore far enough to be considered to be the supplied type. For example if we have base class A, B extends A and this object is a B, and we pass in A here then this returns whether the A part of the object is now inserted.
      Parameters:
      sm - StateManager for the object
      className - Name of class that we want to check the insertion level for.
      Returns:
      Whether the object is inserted in the datastore to this level
    • setObjectIsInsertedToLevel

      public void setObjectIsInsertedToLevel(org.datanucleus.state.DNStateManager sm, DatastoreClass table)
      Method to set that the specified object is inserted down to the defined datastore class. When the object is fully inserted (the table is the primary table for this object type) it is removed from the map of objects being inserted.
      Parameters:
      sm - StateManager for the object
      table - Table to which it is now inserted
    • getExistingBackingStoreForMember

      public org.datanucleus.store.types.scostore.Store getExistingBackingStoreForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
    • getBackingStoreForField

      public org.datanucleus.store.types.scostore.Store getBackingStoreForField(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractMemberMetaData mmd, Class type)
      Accessor for the backing store for the specified member. Note : if we have an embedded object that is embedded into some other type and the object has a member that requires a join table (backing store), this method will not cater for the different places that can be embedded.
      Specified by:
      getBackingStoreForField in interface org.datanucleus.store.BackedSCOStoreManager
      Parameters:
      clr - The ClassLoaderResolver
      mmd - metadata for the member to be persisted by this Store
      type - instantiated type or prefered type
      Returns:
      The backing store
    • getDefaultIdentifierCase

      public String getDefaultIdentifierCase()
      Method to return the default identifier case.
      Returns:
      Identifier case to use if not specified by the user
    • getSchemaCallbacks

      public Map<String,Collection<org.datanucleus.metadata.AbstractMemberMetaData>> getSchemaCallbacks()
    • addSchemaCallback

      public void addSchemaCallback(String className, org.datanucleus.metadata.AbstractMemberMetaData mmd)
    • isJdbcStore

      public boolean isJdbcStore()
      Specified by:
      isJdbcStore in interface org.datanucleus.store.StoreManager
      Overrides:
      isJdbcStore in class org.datanucleus.store.AbstractStoreManager
    • getNativeQueryLanguage

      public String getNativeQueryLanguage()
      Specified by:
      getNativeQueryLanguage in interface org.datanucleus.store.StoreManager
    • getSupportedQueryLanguages

      public Collection<String> getSupportedQueryLanguages()
      Specified by:
      getSupportedQueryLanguages in interface org.datanucleus.store.StoreManager
      Overrides:
      getSupportedQueryLanguages in class org.datanucleus.store.AbstractStoreManager
    • supportsQueryLanguage

      public boolean supportsQueryLanguage(String language)
      Specified by:
      supportsQueryLanguage in interface org.datanucleus.store.StoreManager
      Overrides:
      supportsQueryLanguage in class org.datanucleus.store.AbstractStoreManager
    • newQuery

      public org.datanucleus.store.query.Query newQuery(String language, org.datanucleus.ExecutionContext ec)
      Specified by:
      newQuery in interface org.datanucleus.store.StoreManager
    • newQuery

      public org.datanucleus.store.query.Query newQuery(String language, org.datanucleus.ExecutionContext ec, String queryString)
      Specified by:
      newQuery in interface org.datanucleus.store.StoreManager
    • newQuery

      public org.datanucleus.store.query.Query newQuery(String language, org.datanucleus.ExecutionContext ec, org.datanucleus.store.query.Query q)
      Specified by:
      newQuery in interface org.datanucleus.store.StoreManager
    • logConfiguration

      protected void logConfiguration()
      Convenience method to log the configuration of this store manager.
      Overrides:
      logConfiguration in class org.datanucleus.store.AbstractStoreManager
    • close

      public void close()
      Release of resources
      Specified by:
      close in interface org.datanucleus.store.StoreManager
      Overrides:
      close in class org.datanucleus.store.AbstractStoreManager
    • getNucleusSequence

      public org.datanucleus.store.NucleusSequence getNucleusSequence(org.datanucleus.ExecutionContext ec, org.datanucleus.metadata.SequenceMetaData seqmd)
      Method to return a datastore sequence for this datastore matching the passed sequence MetaData.
      Specified by:
      getNucleusSequence in interface org.datanucleus.store.StoreManager
      Parameters:
      ec - execution context
      seqmd - SequenceMetaData
      Returns:
      The Sequence
    • getSQLController

      public SQLController getSQLController()
      Accessor for the SQL controller.
      Returns:
      The SQL controller
    • getSQLExpressionFactory

      public SQLExpressionFactory getSQLExpressionFactory()
      Accessor for the SQL expression factory to use when generating SQL statements.
      Returns:
      SQL expression factory
    • initialiseSchema

      private void initialiseSchema(Connection conn, org.datanucleus.ClassLoaderResolver clr) throws Exception
      Initialises the schema name for the datastore, and (optionally) the schema table.
      Parameters:
      conn - A connection to the database
      clr - ClassLoader resolver
      Throws:
      Exception
    • clearSchemaData

      private void clearSchemaData()
      Clears all knowledge of tables, cached requests, metadata, etc and resets the store manager to its initial state.
    • getDefaultCatalogName

      public String getDefaultCatalogName()
      Specified by:
      getDefaultCatalogName in interface org.datanucleus.store.StoreManager
    • getDefaultSchemaName

      public String getDefaultSchemaName()
      Specified by:
      getDefaultSchemaName in interface org.datanucleus.store.StoreManager
    • getDatastoreDate

      public Date getDatastoreDate()
      Get the date/time of the datastore.
      Specified by:
      getDatastoreDate in interface org.datanucleus.store.StoreManager
      Returns:
      Date/time of the datastore
    • manageClasses

      public void manageClasses(org.datanucleus.ClassLoaderResolver clr, String... classNames)
      Method to add several persistable classes to the store manager's set of supported classes. This will create any necessary database objects (tables, views, constraints, indexes etc). This will also cause the addition of any related classes.
      Specified by:
      manageClasses in interface org.datanucleus.store.StoreManager
      Overrides:
      manageClasses in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      clr - The ClassLoaderResolver
      classNames - Name of the class(es) to be added.
    • unmanageAllClasses

      public void unmanageAllClasses(org.datanucleus.ClassLoaderResolver clr)
      Utility to remove all classes that we are managing.
      Specified by:
      unmanageAllClasses in interface org.datanucleus.store.StoreManager
      Overrides:
      unmanageAllClasses in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      clr - The ClassLoaderResolver
    • getDdlWriter

      public Writer getDdlWriter()
      Accessor for the writer for DDL (if set).
      Returns:
      DDL writer
    • getCompleteDDL

      public boolean getCompleteDDL()
      Accessor for whether we should generate complete DDL when in that mode. Otherwise will generate "upgrade DDL".
      Returns:
      Generate complete DDL ?
    • hasWrittenDdlStatement

      public boolean hasWrittenDdlStatement(String stmt)
      When we are in SchemaTool DDL mode, return if the supplied statement is already present. This is used to eliminate duplicate statements from a bidirectional relation.
      Parameters:
      stmt - The statement
      Returns:
      Whether we have that statement already
    • addWrittenDdlStatement

      public void addWrittenDdlStatement(String stmt)
      When we are in SchemaTool DDL mode, add a new DDL statement.
      Parameters:
      stmt - The statement
    • validateTable

      public void validateTable(TableImpl table, org.datanucleus.ClassLoaderResolver clr)
      Utility to validate the specified table. This is useful where we have made an update to the columns in a table and want to apply the updates to the datastore.
      Parameters:
      table - The table to validate
      clr - The ClassLoaderResolver
    • getClassNameForObjectID

      public String getClassNameForObjectID(Object id, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.ExecutionContext ec)
      Returns the class corresponding to the given object identity. If the identity is a SCOID, return the SCO class. If the identity is a DatastoreId then returns the associated persistable class name. If the identity is a SingleFieldIdentity then returns the associated persistable class name. If the object is an AppID PK, returns the associated PC class (as far as determinable). If the object id is an application id and the user supplies the "ec" argument then a check can be performed in the datastore where necessary.
      Specified by:
      getClassNameForObjectID in interface org.datanucleus.store.StoreManager
      Overrides:
      getClassNameForObjectID in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      id - The identity of some object.
      clr - ClassLoader resolver
      ec - execution context (optional - to allow check inheritance level in datastore)
      Returns:
      For datastore identity, return the class of the corresponding object. For application identity, return the class of the corresponding object. Otherwise returns null if unable to tie as the identity of a particular class.
    • getResultValueAtPosition

      public Object getResultValueAtPosition(ResultSet rs, JavaTypeMapping mapping, int position)
      Method to return the value from the results for the mapping at the specified position.
      Parameters:
      rs - The results
      mapping - The mapping
      position - The position in the results
      Returns:
      The value at that position
      Throws:
      org.datanucleus.exceptions.NucleusDataStoreException - if an error occurs accessing the results
    • getNextValueForValueGenerator

      protected Object getNextValueForValueGenerator(org.datanucleus.store.valuegenerator.ValueGenerator generator, org.datanucleus.ExecutionContext ec)
      Accessor for the next value from the specified ValueGenerator. This implementation caters for datastore-specific generators and provides synchronisation on the connection to the datastore.
      Overrides:
      getNextValueForValueGenerator in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      generator - The generator
      ec - execution context
      Returns:
      The next value.
    • getPropertiesForValueGenerator

      protected Properties getPropertiesForValueGenerator(org.datanucleus.metadata.AbstractClassMetaData cmd, int absoluteFieldNumber, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.SequenceMetaData seqmd, org.datanucleus.metadata.TableGeneratorMetaData tablegenmd)
      Method to return the properties to pass to the ValueGenerator for the specified field.
      Overrides:
      getPropertiesForValueGenerator in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      cmd - MetaData for the class
      absoluteFieldNumber - Number of the field (-1 = datastore identity)
      clr - ClassLoader resolver
      seqmd - Any sequence metadata
      tablegenmd - Any table generator metadata
      Returns:
      The properties to use for this field
    • getTableForStrategy

      private DatastoreClass getTableForStrategy(org.datanucleus.metadata.AbstractClassMetaData cmd, int fieldNumber, org.datanucleus.ClassLoaderResolver clr)
    • supportsValueGenerationStrategy

      public boolean supportsValueGenerationStrategy(String strategy)
      Accessor for whether this value strategy is supported. Overrides the setting in the superclass for identity/sequence if the adapter doesn't support them.
      Specified by:
      supportsValueGenerationStrategy in interface org.datanucleus.store.StoreManager
      Overrides:
      supportsValueGenerationStrategy in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      strategy - The strategy
      Returns:
      Whether it is supported.
    • getValueGenerationStrategyForNative

      public String getValueGenerationStrategyForNative(org.datanucleus.metadata.AbstractClassMetaData cmd)
      Specified by:
      getValueGenerationStrategyForNative in interface org.datanucleus.store.StoreManager
      Overrides:
      getValueGenerationStrategyForNative in class org.datanucleus.store.AbstractStoreManager
    • getValueGenerationStrategyForNative

      public String getValueGenerationStrategyForNative(org.datanucleus.metadata.AbstractMemberMetaData mmd)
      Specified by:
      getValueGenerationStrategyForNative in interface org.datanucleus.store.StoreManager
      Overrides:
      getValueGenerationStrategyForNative in class org.datanucleus.store.AbstractStoreManager
    • getSQLTypeInfoForJDBCType

      public SQLTypeInfo getSQLTypeInfoForJDBCType(int jdbcType) throws UnsupportedDataTypeException
      Accessor for the SQL type info for the specified JDBC type
      Parameters:
      jdbcType - JDBC type
      Returns:
      (default) SQL type info
      Throws:
      UnsupportedDataTypeException - If the JDBC type is not found
    • getSQLTypeInfoForJDBCType

      public SQLTypeInfo getSQLTypeInfoForJDBCType(int jdbcType, String sqlType) throws UnsupportedDataTypeException
      Accessor for the SQL type info for the specified JDBC type.
      Parameters:
      jdbcType - JDBC type
      sqlType - The SQL type name (if known, otherwise uses the default for this JDBC type).
      Returns:
      SQL type info
      Throws:
      UnsupportedDataTypeException - If the JDBC type is not found
    • getColumnInfoForColumnName

      public RDBMSColumnInfo getColumnInfoForColumnName(Table table, Connection conn, DatastoreIdentifier column) throws SQLException
      Returns the column info for a column name. This should be used instead of making direct calls to DatabaseMetaData.getColumns().

      Where possible, this method loads and caches column info for more than just the table being requested, improving performance by reducing the overall number of calls made to DatabaseMetaData.getColumns() (each of which usually results in one or more database queries).

      Parameters:
      table - The table/view
      conn - JDBC connection to the database.
      column - the column
      Returns:
      The ColumnInfo objects describing the column.
      Throws:
      SQLException - Thrown if an error occurs
    • getColumnInfoForTable

      public List<org.datanucleus.store.schema.StoreSchemaData> getColumnInfoForTable(Table table, Connection conn) throws SQLException
      Returns the column info for a database table. This should be used instead of making direct calls to DatabaseMetaData.getColumns().

      Where possible, this method loads and caches column info for more than just the table being requested, improving performance by reducing the overall number of calls made to DatabaseMetaData.getColumns() (each of which usually results in one or more database queries).

      Parameters:
      table - The table/view
      conn - JDBC connection to the database.
      Returns:
      A list of ColumnInfo objects describing the columns of the table. The list is in the same order as was supplied by getColumns(). If no column info is found for the given table, an empty list is returned.
      Throws:
      SQLException - Thrown if an error occurs
    • invalidateColumnInfoForTable

      public void invalidateColumnInfoForTable(Table table)
      Method to invalidate the cached column info for a table. This is called when we have just added columns to the table in the schema has the effect of a reload of the tables information the next time it is needed.
      Parameters:
      table - The table
    • getManagedTables

      public Collection<Table> getManagedTables(String catalog, String schema)
      Convenience accessor of the Table objects managed in this datastore at this point.
      Parameters:
      catalog - Name of the catalog to restrict the collection by (or null to not restrict)
      schema - Name of the schema to restrict the collection by (or null to not restrict)
      Returns:
      Collection of tables
    • resolveIdentifierMacro

      public void resolveIdentifierMacro(org.datanucleus.util.MacroString.IdentifierMacro im, org.datanucleus.ClassLoaderResolver clr)
      Resolves an identifier macro. The public fields className, fieldName , and subfieldName of the given macro are taken as inputs, and the public value field is set to the SQL identifier of the corresponding database table or column.
      Parameters:
      im - The macro to resolve.
      clr - The ClassLoaderResolver
    • printInformation

      public void printInformation(String category, PrintStream ps) throws Exception
      Method to output particular information owned by this datastore. Supports "DATASTORE" and "SCHEMA" categories.
      Specified by:
      printInformation in interface org.datanucleus.store.StoreManager
      Overrides:
      printInformation in class org.datanucleus.store.AbstractStoreManager
      Parameters:
      category - Category of information
      ps - PrintStream
      Throws:
      Exception - Thrown if an error occurs in the output process
    • executeScript

      public void executeScript(String script)
      Specified by:
      executeScript in interface org.datanucleus.store.schema.SchemaScriptAwareStoreManager
    • getSupportedOptions

      public Collection<String> getSupportedOptions()
      Specified by:
      getSupportedOptions in interface org.datanucleus.store.StoreManager
      Overrides:
      getSupportedOptions in class org.datanucleus.store.AbstractStoreManager
    • allowsBatching

      public boolean allowsBatching()
      Convenience method to return if the datastore supports batching and the user wants batching.
      Returns:
      If batching of statements is permissible
    • usesBackedSCOWrappers

      public boolean usesBackedSCOWrappers()
      Specified by:
      usesBackedSCOWrappers in interface org.datanucleus.store.StoreManager
    • useBackedSCOWrapperForMember

      public boolean useBackedSCOWrapperForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ExecutionContext ec)
      Specified by:
      useBackedSCOWrapperForMember in interface org.datanucleus.store.StoreManager
      Overrides:
      useBackedSCOWrapperForMember in class org.datanucleus.store.AbstractStoreManager
    • getCalendarForDateTimezone

      public Calendar getCalendarForDateTimezone()
      Accessor for the Calendar to be used in handling all timezone issues with the datastore. Utilises the "serverTimeZoneID" in providing this Calendar used in time/date conversions.
      Returns:
      The calendar to use for dateTimezone issues.
    • newJoinTable

      public Table newJoinTable(Table ownerTable, org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
      Called by (container) Mapping objects to request the creation of a join table. If the specified field doesn't require a join table then this returns null. If the join table already exists, then this returns it.
      Parameters:
      ownerTable - The table that owns this member.
      mmd - The metadata describing the field/property.
      clr - The ClassLoaderResolver
      Returns:
      The table (SetTable/ListTable/MapTable/ArrayTable)
    • registerTableInitialized

      public void registerTableInitialized(Table table)
    • createDatabase

      public void createDatabase(String catalogName, String schemaName, Properties props)
      Specified by:
      createDatabase in interface org.datanucleus.store.schema.SchemaAwareStoreManager
    • deleteDatabase

      public void deleteDatabase(String catalogName, String schemaName, Properties props)
      Specified by:
      deleteDatabase in interface org.datanucleus.store.schema.SchemaAwareStoreManager
    • createSchemaForClasses

      public void createSchemaForClasses(Set<String> classNames, Properties props)
      Specified by:
      createSchemaForClasses in interface org.datanucleus.store.schema.SchemaAwareStoreManager
    • createSchemaSequences

      protected void createSchemaSequences(Set<String> classNames, org.datanucleus.ClassLoaderResolver clr, FileWriter ddlWriter)
    • addSequenceTableForMetaData

      protected void addSequenceTableForMetaData(org.datanucleus.metadata.MetaData md, org.datanucleus.ClassLoaderResolver clr, Set<String> seqTablesGenerated)
    • addSequenceForMetaData

      protected void addSequenceForMetaData(org.datanucleus.metadata.MetaData md, String seq, org.datanucleus.ClassLoaderResolver clr, Set<String> sequencesGenerated, FileWriter ddlWriter)
    • deleteSchemaForClasses

      public void deleteSchemaForClasses(Set<String> classNames, Properties props)
      Specified by:
      deleteSchemaForClasses in interface org.datanucleus.store.schema.SchemaAwareStoreManager
    • validateSchemaForClasses

      public void validateSchemaForClasses(Set<String> classNames, Properties props)
      Specified by:
      validateSchemaForClasses in interface org.datanucleus.store.schema.SchemaAwareStoreManager