public class RDBMSStoreManager
extends org.datanucleus.store.AbstractStoreManager
implements org.datanucleus.store.BackedSCOStoreManager, org.datanucleus.store.schema.SchemaAwareStoreManager, org.datanucleus.store.schema.SchemaScriptAwareStoreManager
The RDBMS manager's responsibilities extend those for StoreManager to add :
Modifier and Type | Field and Description |
---|---|
protected String |
catalogName
Catalog name for the database (if supported).
|
protected DatastoreAdapter |
dba
Adapter for the datastore being used.
|
protected SQLExpressionFactory |
expressionFactory
Factory for expressions using the generic query SQL mechanism.
|
protected IdentifierFactory |
identifierFactory
Factory for identifiers for this datastore.
|
protected Map<org.datanucleus.state.ObjectProvider,DatastoreClass> |
insertedDatastoreClassByStateManager
Map of DatastoreClass keyed by StateManager, for objects currently being inserted.
|
protected MappedTypeManager |
mappedTypeMgr
TypeManager for mapped information.
|
protected MappingManager |
mappingManager
Manager for the mapping between Java and datastore types.
|
static String |
METADATA_NONDURABLE_REQUIRES_TABLE |
protected ReadWriteLock |
schemaLock
Lock object aimed at providing a lock on the schema definition managed here, preventing
reads while it is being updated etc.
|
protected String |
schemaName
Schema name for the database (if supported).
|
connectionMgr, flushProcess, namingFactory, nucleusContext, persistenceHandler, primaryConnectionFactoryName, queryMgr, schemaHandler, secondaryConnectionFactoryName, storeDataMgr, storeManagerKey, valueGenerationMgr
OPTION_APPLICATION_COMPOSITE_ID, OPTION_APPLICATION_ID, OPTION_DATASTORE_ID, OPTION_DATASTORE_TIMEOUT, OPTION_NONDURABLE_ID, OPTION_ORM, OPTION_ORM_EMBEDDED_ARRAY, OPTION_ORM_EMBEDDED_ARRAY_NESTED, OPTION_ORM_EMBEDDED_COLLECTION, OPTION_ORM_EMBEDDED_COLLECTION_NESTED, OPTION_ORM_EMBEDDED_MAP, OPTION_ORM_EMBEDDED_MAP_NESTED, OPTION_ORM_EMBEDDED_PC, OPTION_ORM_EMBEDDED_PC_NESTED, OPTION_ORM_FOREIGN_KEYS, OPTION_ORM_SECONDARY_TABLE, OPTION_QUERY_CANCEL, OPTION_TXN_ISOLATION_READ_COMMITTED, OPTION_TXN_ISOLATION_READ_UNCOMMITTED, OPTION_TXN_ISOLATION_REPEATABLE_READ, OPTION_TXN_ISOLATION_SERIALIZABLE
Constructor and Description |
---|
RDBMSStoreManager(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.PersistenceNucleusContext ctx,
Map<String,Object> props)
Constructs a new RDBMSManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addSchemaCallback(String className,
org.datanucleus.metadata.AbstractMemberMetaData mmd) |
protected void |
addSequenceForMetaData(org.datanucleus.metadata.MetaData md,
String seq,
org.datanucleus.ClassLoaderResolver clr,
Set<String> sequencesGenerated,
FileWriter ddlWriter) |
protected void |
addSequenceTableForMetaData(org.datanucleus.metadata.MetaData md,
org.datanucleus.ClassLoaderResolver clr,
Set<String> seqTablesGenerated) |
void |
addWrittenDdlStatement(String stmt)
When we are in SchemaTool DDL mode, add a new DDL statement.
|
boolean |
allowsBatching()
Convenience method to return if the datastore supports batching and the user wants batching.
|
protected static Set<String> |
cleanInputClassNames(org.datanucleus.NucleusContext ctx,
Set<String> inputClassNames)
Method to generate a set of class names using the input list.
|
void |
close()
Release of resources
|
void |
createSchema(String schemaName,
Properties props) |
void |
createSchemaForClasses(Set<String> inputClassNames,
Properties props) |
protected void |
createSchemaSequences(Set<String> classNames,
org.datanucleus.ClassLoaderResolver clr,
FileWriter ddlWriter) |
void |
deleteSchema(String schemaName,
Properties props) |
void |
deleteSchemaForClasses(Set<String> inputClassNames,
Properties props) |
void |
executeScript(String script) |
protected org.datanucleus.store.scostore.ArrayStore |
getBackingStoreForArray(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ClassLoaderResolver clr)
Method to return a backing store for an array, consistent with this store and the instantiated type.
|
protected org.datanucleus.store.scostore.CollectionStore |
getBackingStoreForCollection(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ClassLoaderResolver clr,
Class type)
Method to return a backing store for a Collection, consistent with this store and the instantiated type.
|
org.datanucleus.store.scostore.Store |
getBackingStoreForField(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.metadata.AbstractMemberMetaData mmd,
Class type)
Accessor for the backing store for the specified member.
|
protected org.datanucleus.store.scostore.MapStore |
getBackingStoreForMap(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ClassLoaderResolver clr)
Method to return a backing store for a Map, consistent with this store and the instantiated type.
|
protected org.datanucleus.store.scostore.PersistableRelationStore |
getBackingStoreForPersistableRelation(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ClassLoaderResolver clr)
Method to return a backing store for a persistable relation (N-1 uni via join).
|
Calendar |
getCalendarForDateTimezone()
Accessor for the Calendar to be used in handling all timezone issues with the datastore.
|
String |
getCatalogName()
Accessor for the (default) RDBMS catalog name.
|
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.
|
String |
getClassNameForObjectID(Object id,
org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.ExecutionContext ec)
Returns the class corresponding to the given object identity.
|
RDBMSColumnInfo |
getColumnInfoForColumnName(Table table,
Connection conn,
DatastoreIdentifier column)
Returns the column info for a column name.
|
List |
getColumnInfoForTable(Table table,
Connection conn)
Returns the column info for a database table.
|
boolean |
getCompleteDDL()
Accessor for whether we should generate complete DDL when in that mode.
|
DatastoreAdapter |
getDatastoreAdapter()
Gets the DatastoreAdapter to use for this store.
|
DatastoreClass |
getDatastoreClass(DatastoreIdentifier name)
Returns the datastore table having the given identifier.
|
DatastoreClass |
getDatastoreClass(String className,
org.datanucleus.ClassLoaderResolver clr)
Returns the primary datastore table serving as backing for the given class.
|
Date |
getDatastoreDate()
Get the date/time of the datastore.
|
Writer |
getDdlWriter()
Accessor for the writer for DDL (if set).
|
String |
getDefaultIdentifierCase()
Method to return the default identifier case.
|
String |
getDefaultObjectProviderClassName() |
org.datanucleus.store.fieldmanager.FieldManager |
getFieldManagerForResultProcessing(org.datanucleus.ExecutionContext ec,
ResultSet rs,
StatementClassMapping resultMappings,
org.datanucleus.metadata.AbstractClassMetaData cmd) |
org.datanucleus.store.fieldmanager.FieldManager |
getFieldManagerForResultProcessing(org.datanucleus.state.ObjectProvider op,
ResultSet rs,
StatementClassMapping resultMappings) |
org.datanucleus.store.fieldmanager.FieldManager |
getFieldManagerForStatementGeneration(org.datanucleus.state.ObjectProvider sm,
PreparedStatement ps,
StatementClassMapping stmtMappings)
Method to return a FieldManager for populating information in statements.
|
IdentifierFactory |
getIdentifierFactory()
Accessor for the factory for creating identifiers (table/column names etc).
|
Collection<Table> |
getManagedTables(String catalog,
String schema)
Convenience accessor of the Table objects managed in this datastore at this point.
|
MappedTypeManager |
getMappedTypeManager()
Accessor for the manager of mapped type information.
|
MappingManager |
getMappingManager()
Gets the MappingManager to use for this store.
|
String |
getNativeQueryLanguage() |
org.datanucleus.store.NucleusConnection |
getNucleusConnection(org.datanucleus.ExecutionContext ec)
Method to return a NucleusConnection for the ExecutionContext.
|
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.
|
protected Properties |
getPropertiesForGenerator(org.datanucleus.metadata.AbstractClassMetaData cmd,
int absoluteFieldNumber,
org.datanucleus.ExecutionContext ec,
org.datanucleus.metadata.SequenceMetaData seqmd,
org.datanucleus.metadata.TableGeneratorMetaData tablegenmd)
Method to return the properties to pass to the generator for the specified field.
|
String |
getQueryCacheKey() |
Object |
getResultValueAtPosition(ResultSet rs,
JavaTypeMapping mapping,
int position)
Method to return the value from the results for the mapping at the specified position.
|
org.datanucleus.util.MultiMap |
getSchemaCallbacks() |
String |
getSchemaName()
Accessor for the (default) RDBMS schema name.
|
SQLController |
getSQLController()
Accessor for the SQL controller.
|
SQLExpressionFactory |
getSQLExpressionFactory()
Accessor for the SQL expression factory to use when generating SQL statements.
|
SQLTypeInfo |
getSQLTypeInfoForJDBCType(int jdbcType)
Accessor for the SQL type info for the specified JDBC type
|
SQLTypeInfo |
getSQLTypeInfoForJDBCType(int jdbcType,
String sqlType)
Accessor for the SQL type info for the specified JDBC type.
|
org.datanucleus.store.StoreData[] |
getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
Utility to return all StoreData for a Datastore Container identifier.
|
String |
getStrategyForNative(org.datanucleus.metadata.AbstractClassMetaData cmd,
int absFieldNumber)
Method defining which value-strategy to use when the user specifies "native".
|
protected Object |
getStrategyValueForGenerator(org.datanucleus.store.valuegenerator.ValueGenerator generator,
org.datanucleus.ExecutionContext ec)
Accessor for the next value from the specified generator.
|
Collection |
getSupportedOptions()
Accessor for the supported options in string form
|
Table |
getTable(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Returns the datastore container (table) for the specified field.
|
boolean |
hasWrittenDdlStatement(String stmt)
When we are in SchemaTool DDL mode, return if the supplied statement is already present.
|
protected void |
initialiseIdentifierFactory(org.datanucleus.NucleusContext nucleusContext)
Method to create the IdentifierFactory to be used by this store.
|
boolean |
insertValuesOnInsert(DatastoreMapping datastoreMapping)
Accessor for whether this mapping requires values inserting on an INSERT.
|
void |
invalidateColumnInfoForTable(Table table)
Method to invalidate the cached column info for a table.
|
boolean |
isJdbcStore() |
boolean |
isObjectInserted(org.datanucleus.state.ObjectProvider op,
int fieldNumber)
Accessor for whether the specified field of the object is inserted in the datastore yet.
|
boolean |
isObjectInserted(org.datanucleus.state.ObjectProvider op,
String className)
Returns whether this object is inserted in the datastore far enough to be considered to be the
supplied type.
|
protected void |
logConfiguration()
Convenience method to log the configuration of this store manager.
|
void |
manageClasses(org.datanucleus.ClassLoaderResolver clr,
String... classNames)
Method to add several persistable classes to the store manager's set of supported classes.
|
Table |
newJoinTable(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ClassLoaderResolver clr)
Called by (container) Mapping objects to request the creation of a join table.
|
ResultObjectFactory |
newResultObjectFactory(org.datanucleus.metadata.AbstractClassMetaData acmd,
StatementClassMapping mappingDefinition,
boolean ignoreCache,
org.datanucleus.FetchPlan fetchPlan,
Class persistentClass) |
void |
printInformation(String category,
PrintStream ps)
Method to output particular information owned by this datastore.
|
void |
registerTableInitialized(Table table) |
void |
resolveIdentifierMacro(org.datanucleus.util.MacroString.IdentifierMacro im,
org.datanucleus.ClassLoaderResolver clr)
Resolves an identifier macro.
|
void |
setObjectIsInsertedToLevel(org.datanucleus.state.ObjectProvider op,
DatastoreClass table)
Method to set that the specified object is inserted down to the defined datastore class.
|
boolean |
supportsValueStrategy(String strategy)
Accessor for whether this value strategy is supported.
|
void |
unmanageAllClasses(org.datanucleus.ClassLoaderResolver clr)
Utility to remove all classes that we are managing.
|
boolean |
useBackedSCOWrapperForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd,
org.datanucleus.ExecutionContext ec) |
boolean |
usesBackedSCOWrappers() |
void |
validateSchemaForClasses(Set<String> inputClassNames,
Properties props) |
void |
validateTable(TableImpl table,
org.datanucleus.ClassLoaderResolver clr)
Utility to validate the specified table.
|
deregisterAllStoreData, getApiAdapter, getBooleanObjectProperty, getBooleanProperty, getBooleanProperty, getConnection, getConnection, getConnection, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionManager, getConnectionPassword, getConnectionURL, getConnectionUserName, getExtent, getFlushProcess, getIntProperty, getMetaDataManager, getNamingFactory, getNucleusContext, getPersistenceHandler, getProperty, getQueryManager, getSchemaHandler, getStoreDataForClass, getStoreManagerKey, getStrategyValue, getStringProperty, getSubClassesForClass, getValueGenerationManager, hasProperty, isStrategyDatastoreAttributed, manageClassForIdentity, managesClass, newStoreData, registerConnectionFactory, registerConnectionMgr, registerStoreData, supportsQueryLanguage, transactionCommitted, transactionRolledBack, transactionStarted, unmanageClass
public static final String METADATA_NONDURABLE_REQUIRES_TABLE
protected DatastoreAdapter dba
protected IdentifierFactory identifierFactory
protected String catalogName
protected String schemaName
protected MappedTypeManager mappedTypeMgr
protected MappingManager mappingManager
protected Map<org.datanucleus.state.ObjectProvider,DatastoreClass> insertedDatastoreClassByStateManager
protected ReadWriteLock schemaLock
protected SQLExpressionFactory expressionFactory
public RDBMSStoreManager(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.PersistenceNucleusContext ctx, Map<String,Object> props)
clr
- the ClassLoaderResolverctx
- 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 datastoreorg.datanucleus.exceptions.NucleusDataStoreException
- If the database could not be accessed or the name of the
schema could not be determined.public String getQueryCacheKey()
getQueryCacheKey
in interface org.datanucleus.store.StoreManager
getQueryCacheKey
in class org.datanucleus.store.AbstractStoreManager
protected void initialiseIdentifierFactory(org.datanucleus.NucleusContext nucleusContext)
nucleusContext
- contextpublic boolean supportsValueStrategy(String strategy)
supportsValueStrategy
in interface org.datanucleus.store.StoreManager
supportsValueStrategy
in class org.datanucleus.store.AbstractStoreManager
strategy
- The strategypublic MappedTypeManager getMappedTypeManager()
public IdentifierFactory getIdentifierFactory()
public DatastoreAdapter getDatastoreAdapter()
public MappingManager getMappingManager()
public String getDefaultObjectProviderClassName()
getDefaultObjectProviderClassName
in interface org.datanucleus.store.StoreManager
getDefaultObjectProviderClassName
in class org.datanucleus.store.AbstractStoreManager
public org.datanucleus.store.StoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
tableIdentifier
- Identifier for the tablepublic Table getTable(org.datanucleus.metadata.AbstractMemberMetaData mmd)
mmd
- The metadata for the field.public DatastoreClass getDatastoreClass(String className, org.datanucleus.ClassLoaderResolver clr)
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.
className
- Name of the class whose table is be returned.clr
- The ClassLoaderResolverNoTableManagedException
- If the given class has no table managed in the database.public DatastoreClass getDatastoreClass(DatastoreIdentifier name)
name
- The identifier name of the table.public org.datanucleus.metadata.AbstractClassMetaData[] getClassesManagingTableForClass(org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr)
cmd
- The supplied class.clr
- ClassLoader resolverpublic boolean isObjectInserted(org.datanucleus.state.ObjectProvider op, int fieldNumber)
op
- ObjectProvider for the objectfieldNumber
- (Absolute) field number for the objectpublic boolean isObjectInserted(org.datanucleus.state.ObjectProvider op, String className)
op
- ObjectProvider for the objectclassName
- Name of class that we want to check the insertion level for.public void setObjectIsInsertedToLevel(org.datanucleus.state.ObjectProvider op, DatastoreClass table)
op
- ObjectProvider for the objecttable
- Table to which it is now insertedpublic org.datanucleus.store.scostore.Store getBackingStoreForField(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractMemberMetaData mmd, Class type)
getBackingStoreForField
in interface org.datanucleus.store.BackedSCOStoreManager
clr
- The ClassLoaderResolvermmd
- metadata for the member to be persisted by this Storetype
- instantiated type or prefered typeprotected org.datanucleus.store.scostore.CollectionStore getBackingStoreForCollection(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr, Class type)
mmd
- MetaData for the field that has this collectionclr
- ClassLoader resolverprotected org.datanucleus.store.scostore.MapStore getBackingStoreForMap(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
mmd
- MetaData for the field that has this mapclr
- ClassLoader resolverprotected org.datanucleus.store.scostore.ArrayStore getBackingStoreForArray(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
mmd
- MetaData for the field/property that has this arrayclr
- ClassLoader resolverprotected org.datanucleus.store.scostore.PersistableRelationStore getBackingStoreForPersistableRelation(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
mmd
- MetaData for the member being storedclr
- ClassLoader resolverpublic String getDefaultIdentifierCase()
public org.datanucleus.util.MultiMap getSchemaCallbacks()
public void addSchemaCallback(String className, org.datanucleus.metadata.AbstractMemberMetaData mmd)
public boolean isJdbcStore()
isJdbcStore
in interface org.datanucleus.store.StoreManager
isJdbcStore
in class org.datanucleus.store.AbstractStoreManager
public String getNativeQueryLanguage()
getNativeQueryLanguage
in interface org.datanucleus.store.StoreManager
getNativeQueryLanguage
in class org.datanucleus.store.AbstractStoreManager
protected void logConfiguration()
logConfiguration
in class org.datanucleus.store.AbstractStoreManager
public void close()
close
in interface org.datanucleus.store.StoreManager
close
in class org.datanucleus.store.AbstractStoreManager
public org.datanucleus.store.NucleusSequence getNucleusSequence(org.datanucleus.ExecutionContext ec, org.datanucleus.metadata.SequenceMetaData seqmd)
getNucleusSequence
in interface org.datanucleus.store.StoreManager
getNucleusSequence
in class org.datanucleus.store.AbstractStoreManager
ec
- execution contextseqmd
- SequenceMetaDatapublic org.datanucleus.store.NucleusConnection getNucleusConnection(org.datanucleus.ExecutionContext ec)
getNucleusConnection
in interface org.datanucleus.store.StoreManager
getNucleusConnection
in class org.datanucleus.store.AbstractStoreManager
ec
- execution contextpublic SQLController getSQLController()
public SQLExpressionFactory getSQLExpressionFactory()
public String getCatalogName()
public String getSchemaName()
public Date getDatastoreDate()
getDatastoreDate
in interface org.datanucleus.store.StoreManager
getDatastoreDate
in class org.datanucleus.store.AbstractStoreManager
public void manageClasses(org.datanucleus.ClassLoaderResolver clr, String... classNames)
manageClasses
in interface org.datanucleus.store.StoreManager
manageClasses
in class org.datanucleus.store.AbstractStoreManager
clr
- The ClassLoaderResolverclassNames
- Name of the class(es) to be added.public void unmanageAllClasses(org.datanucleus.ClassLoaderResolver clr)
unmanageAllClasses
in interface org.datanucleus.store.StoreManager
unmanageAllClasses
in class org.datanucleus.store.AbstractStoreManager
clr
- The ClassLoaderResolverpublic Writer getDdlWriter()
public boolean getCompleteDDL()
public boolean hasWrittenDdlStatement(String stmt)
stmt
- The statementpublic void addWrittenDdlStatement(String stmt)
stmt
- The statementpublic void validateTable(TableImpl table, org.datanucleus.ClassLoaderResolver clr)
table
- The table to validateclr
- The ClassLoaderResolverpublic String getClassNameForObjectID(Object id, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.ExecutionContext ec)
getClassNameForObjectID
in interface org.datanucleus.store.StoreManager
getClassNameForObjectID
in class org.datanucleus.store.AbstractStoreManager
id
- The identity of some object.clr
- ClassLoader resolverec
- execution context (optional - to allow check inheritance level in datastore)public org.datanucleus.store.fieldmanager.FieldManager getFieldManagerForResultProcessing(org.datanucleus.state.ObjectProvider op, ResultSet rs, StatementClassMapping resultMappings)
public org.datanucleus.store.fieldmanager.FieldManager getFieldManagerForResultProcessing(org.datanucleus.ExecutionContext ec, ResultSet rs, StatementClassMapping resultMappings, org.datanucleus.metadata.AbstractClassMetaData cmd)
public org.datanucleus.store.fieldmanager.FieldManager getFieldManagerForStatementGeneration(org.datanucleus.state.ObjectProvider sm, PreparedStatement ps, StatementClassMapping stmtMappings)
sm
- The ObjectProvider for the object.ps
- The Prepared Statement to set values on.stmtMappings
- the index of parameters/mappingspublic Object getResultValueAtPosition(ResultSet rs, JavaTypeMapping mapping, int position)
rs
- The resultsmapping
- The mappingposition
- The position in the resultsorg.datanucleus.exceptions.NucleusDataStoreException
- if an error occurs accessing the resultsprotected Object getStrategyValueForGenerator(org.datanucleus.store.valuegenerator.ValueGenerator generator, org.datanucleus.ExecutionContext ec)
getStrategyValueForGenerator
in class org.datanucleus.store.AbstractStoreManager
generator
- The generatorec
- execution contextprotected Properties getPropertiesForGenerator(org.datanucleus.metadata.AbstractClassMetaData cmd, int absoluteFieldNumber, org.datanucleus.ExecutionContext ec, org.datanucleus.metadata.SequenceMetaData seqmd, org.datanucleus.metadata.TableGeneratorMetaData tablegenmd)
getPropertiesForGenerator
in class org.datanucleus.store.AbstractStoreManager
cmd
- MetaData for the classabsoluteFieldNumber
- Number of the field (-1 = datastore identity)ec
- execution contextseqmd
- Any sequence metadatatablegenmd
- Any table generator metadatapublic String getStrategyForNative(org.datanucleus.metadata.AbstractClassMetaData cmd, int absFieldNumber)
getStrategyForNative
in class org.datanucleus.store.AbstractStoreManager
public SQLTypeInfo getSQLTypeInfoForJDBCType(int jdbcType) throws UnsupportedDataTypeException
jdbcType
- JDBC typeUnsupportedDataTypeException
- If the JDBC type is not foundpublic SQLTypeInfo getSQLTypeInfoForJDBCType(int jdbcType, String sqlType) throws UnsupportedDataTypeException
jdbcType
- JDBC typesqlType
- The SQL type name (if known, otherwise uses the default for this JDBC type).UnsupportedDataTypeException
- If the JDBC type is not foundpublic RDBMSColumnInfo getColumnInfoForColumnName(Table table, Connection conn, DatastoreIdentifier column) throws SQLException
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).
table
- The table/viewconn
- JDBC connection to the database.column
- the columnSQLException
- Thrown if an error occurspublic List getColumnInfoForTable(Table table, Connection conn) throws SQLException
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).
table
- The table/viewconn
- JDBC connection to the database.SQLException
- Thrown if an error occurspublic void invalidateColumnInfoForTable(Table table)
table
- The tablepublic Collection<Table> getManagedTables(String catalog, String schema)
catalog
- Name of the catalog to restrict the collection byschema
- Name of the schema to restrict the collection bypublic void resolveIdentifierMacro(org.datanucleus.util.MacroString.IdentifierMacro im, org.datanucleus.ClassLoaderResolver clr)
im
- The macro to resolve.clr
- The ClassLoaderResolverpublic void printInformation(String category, PrintStream ps) throws Exception
printInformation
in interface org.datanucleus.store.StoreManager
printInformation
in class org.datanucleus.store.AbstractStoreManager
category
- Category of informationps
- PrintStreamException
- Thrown if an error occurs in the output processpublic Table newJoinTable(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
mmd
- The metadata describing the field/property.clr
- The ClassLoaderResolverpublic void registerTableInitialized(Table table)
public Collection getSupportedOptions()
getSupportedOptions
in interface org.datanucleus.store.StoreManager
getSupportedOptions
in class org.datanucleus.store.AbstractStoreManager
public boolean insertValuesOnInsert(DatastoreMapping datastoreMapping)
datastoreMapping
- The datastore mappingpublic boolean allowsBatching()
public ResultObjectFactory newResultObjectFactory(org.datanucleus.metadata.AbstractClassMetaData acmd, StatementClassMapping mappingDefinition, boolean ignoreCache, org.datanucleus.FetchPlan fetchPlan, Class persistentClass)
public boolean usesBackedSCOWrappers()
usesBackedSCOWrappers
in class org.datanucleus.store.AbstractStoreManager
public boolean useBackedSCOWrapperForMember(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ExecutionContext ec)
useBackedSCOWrapperForMember
in interface org.datanucleus.store.StoreManager
useBackedSCOWrapperForMember
in class org.datanucleus.store.AbstractStoreManager
public Calendar getCalendarForDateTimezone()
public void createSchema(String schemaName, Properties props)
createSchema
in interface org.datanucleus.store.schema.SchemaAwareStoreManager
public void deleteSchema(String schemaName, Properties props)
deleteSchema
in interface org.datanucleus.store.schema.SchemaAwareStoreManager
public void createSchemaForClasses(Set<String> inputClassNames, Properties props)
createSchemaForClasses
in interface org.datanucleus.store.schema.SchemaAwareStoreManager
protected void createSchemaSequences(Set<String> classNames, org.datanucleus.ClassLoaderResolver clr, FileWriter ddlWriter)
protected void addSequenceTableForMetaData(org.datanucleus.metadata.MetaData md, org.datanucleus.ClassLoaderResolver clr, Set<String> seqTablesGenerated)
protected void addSequenceForMetaData(org.datanucleus.metadata.MetaData md, String seq, org.datanucleus.ClassLoaderResolver clr, Set<String> sequencesGenerated, FileWriter ddlWriter)
public void deleteSchemaForClasses(Set<String> inputClassNames, Properties props)
deleteSchemaForClasses
in interface org.datanucleus.store.schema.SchemaAwareStoreManager
public void validateSchemaForClasses(Set<String> inputClassNames, Properties props)
validateSchemaForClasses
in interface org.datanucleus.store.schema.SchemaAwareStoreManager
public void executeScript(String script)
executeScript
in interface org.datanucleus.store.schema.SchemaScriptAwareStoreManager
protected static Set<String> cleanInputClassNames(org.datanucleus.NucleusContext ctx, Set<String> inputClassNames)
ctx
- NucleusContextinputClassNames
- Class names to start fromCopyright © 2015. All rights reserved.