public class RDBMSSchemaHandler
extends org.datanucleus.store.schema.AbstractStoreSchemaHandler
Modifier and Type | Field and Description |
---|---|
protected static long |
COLUMN_INFO_EXPIRATION_MS
Time within which column info is valid (millisecs).
|
protected RDBMSStoreManager |
rdbmsStoreMgr |
protected Map<String,org.datanucleus.store.schema.StoreSchemaData> |
schemaDataByName
Map of schema data, keyed by its symbolic name where the data is cached.
|
static String |
TYPE_CATALOG |
static String |
TYPE_COLUMN |
static String |
TYPE_COLUMNS |
static String |
TYPE_FKS |
static String |
TYPE_INDICES |
static String |
TYPE_PKS |
static String |
TYPE_SCHEMA |
static String |
TYPE_TABLES |
static String |
TYPE_TYPES |
Constructor and Description |
---|
RDBMSSchemaHandler(org.datanucleus.store.StoreManager storeMgr) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Method to clear out any cached schema information.
|
void |
createDatabase(String catalogName,
String schemaName,
Properties props,
Object connection) |
void |
createSchemaForClasses(Set<String> classNames,
Properties props,
Object connection) |
void |
deleteDatabase(String catalogName,
String schemaName,
Properties props,
Object connection) |
void |
deleteSchemaForClasses(Set<String> classNames,
Properties props,
Object connection) |
protected DatastoreAdapter |
getDatastoreAdapter() |
protected RDBMSColumnInfo |
getRDBMSColumnInfoForColumn(Connection conn,
Table table,
String columnName)
Convenience method to get the column info from the datastore for the column in the specified table.
|
protected RDBMSSchemaInfo |
getRDBMSSchemaInfoForCatalogSchema(Connection conn,
String catalog,
String schema)
Convenience method to retrieve schema information for all tables in the specified catalog/schema.
|
protected RDBMSSchemaInfo |
getRDBMSSchemasInfo(Connection conn,
String schemaName,
String catalogName)
Convenience method to read the schemas information for this datastore.
|
protected RDBMSTableFKInfo |
getRDBMSTableFKInfoForTable(Connection conn,
String catalogName,
String schemaName,
String tableName)
Convenience method to get the ForeignKey info for the specified table from the datastore.
|
protected RDBMSTableFKInfo |
getRDBMSTableFKInfoForTable(Connection conn,
Table table)
Convenience method to get the ForeignKey info for the specified table from the datastore.
|
protected RDBMSTableIndexInfo |
getRDBMSTableIndexInfoForTable(Connection conn,
String catalogName,
String schemaName,
String tableName)
Convenience method to get the index info for the catalog+schema+tableName in the datastore.
|
protected RDBMSTableIndexInfo |
getRDBMSTableIndexInfoForTable(Connection conn,
Table table)
Convenience method to get the index info for the specified table from the datastore.
|
protected RDBMSTableInfo |
getRDBMSTableInfoForTable(Connection conn,
String catalogName,
String schemaName,
String tableName)
Convenience method to get the column info for the catalog+schema+tableName in the datastore.
|
protected RDBMSTableInfo |
getRDBMSTableInfoForTable(Connection conn,
Table table)
Convenience method to get the column info for the specified table from the datastore.
|
protected RDBMSTablePKInfo |
getRDBMSTablePKInfoForTable(Connection conn,
String catalogName,
String schemaName,
String tableName)
Convenience method to get the PrimaryKey info for the specified table from the datastore.
|
protected RDBMSTablePKInfo |
getRDBMSTablePKInfoForTable(Connection conn,
Table table)
Convenience method to get the PrimaryKey info for the specified table from the datastore.
|
protected RDBMSTypesInfo |
getRDBMSTypesInfo(Connection conn)
Convenience method to read and cache the types information for this datastore.
|
org.datanucleus.store.schema.StoreSchemaData |
getSchemaData(Object connection,
String name,
Object[] values)
Accessor for schema data store under the provided name and defined by the specified values.
|
String |
getTableType(Connection conn,
Table table)
Returns the type of a database table/view in the datastore.
|
void |
validateSchema(Set<String> classNames,
Properties props,
Object connection) |
protected static final long COLUMN_INFO_EXPIRATION_MS
protected final RDBMSStoreManager rdbmsStoreMgr
public static final String TYPE_TYPES
public static final String TYPE_TABLES
public static final String TYPE_FKS
public static final String TYPE_PKS
public static final String TYPE_INDICES
public static final String TYPE_COLUMNS
public static final String TYPE_COLUMN
public static final String TYPE_SCHEMA
public static final String TYPE_CATALOG
public RDBMSSchemaHandler(org.datanucleus.store.StoreManager storeMgr)
protected DatastoreAdapter getDatastoreAdapter()
public void clear()
clear
in interface org.datanucleus.store.schema.StoreSchemaHandler
clear
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public void createDatabase(String catalogName, String schemaName, Properties props, Object connection)
createDatabase
in interface org.datanucleus.store.schema.StoreSchemaHandler
createDatabase
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public void deleteDatabase(String catalogName, String schemaName, Properties props, Object connection)
deleteDatabase
in interface org.datanucleus.store.schema.StoreSchemaHandler
deleteDatabase
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public void createSchemaForClasses(Set<String> classNames, Properties props, Object connection)
createSchemaForClasses
in interface org.datanucleus.store.schema.StoreSchemaHandler
createSchemaForClasses
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public void deleteSchemaForClasses(Set<String> classNames, Properties props, Object connection)
deleteSchemaForClasses
in interface org.datanucleus.store.schema.StoreSchemaHandler
deleteSchemaForClasses
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public void validateSchema(Set<String> classNames, Properties props, Object connection)
validateSchema
in interface org.datanucleus.store.schema.StoreSchemaHandler
validateSchema
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
public org.datanucleus.store.schema.StoreSchemaData getSchemaData(Object connection, String name, Object[] values)
getSchemaData
in interface org.datanucleus.store.schema.StoreSchemaHandler
getSchemaData
in class org.datanucleus.store.schema.AbstractStoreSchemaHandler
connection
- Connection to the datastorename
- Name of the schema component to return.values
- Value(s) to use as qualifier(s) for selecting the schema componentpublic String getTableType(Connection conn, Table table) throws SQLException
conn
- Connection to the database.table
- The table/viewSQLException
- if an error occurs obtaining the informationprotected RDBMSTypesInfo getRDBMSTypesInfo(Connection conn)
conn
- Connection to the datastoreprotected RDBMSSchemaInfo getRDBMSSchemasInfo(Connection conn, String schemaName, String catalogName)
conn
- Connection to the datastoreschemaName
- Name of the schema to check forcatalogName
- Name of the catalog to check forprotected RDBMSTableFKInfo getRDBMSTableFKInfoForTable(Connection conn, Table table)
conn
- Connection to usetable
- The tableprotected RDBMSTableFKInfo getRDBMSTableFKInfoForTable(Connection conn, String catalogName, String schemaName, String tableName)
conn
- Connection to usecatalogName
- CatalogschemaName
- SchematableName
- Name of the tableprotected RDBMSTablePKInfo getRDBMSTablePKInfoForTable(Connection conn, Table table)
conn
- Connection to usetable
- The tableprotected RDBMSTablePKInfo getRDBMSTablePKInfoForTable(Connection conn, String catalogName, String schemaName, String tableName)
conn
- Connection to usecatalogName
- CatalogschemaName
- SchematableName
- Name of the tableprotected RDBMSTableIndexInfo getRDBMSTableIndexInfoForTable(Connection conn, Table table)
conn
- Connection to usetable
- The tableprotected RDBMSTableIndexInfo getRDBMSTableIndexInfoForTable(Connection conn, String catalogName, String schemaName, String tableName)
conn
- Connection to usecatalogName
- CatalogschemaName
- SchematableName
- Name of the tableprotected RDBMSSchemaInfo getRDBMSSchemaInfoForCatalogSchema(Connection conn, String catalog, String schema)
conn
- Connectioncatalog
- Catalogschema
- Schemaprotected RDBMSTableInfo getRDBMSTableInfoForTable(Connection conn, Table table)
conn
- Connection to usetable
- The tableprotected RDBMSTableInfo getRDBMSTableInfoForTable(Connection conn, String catalogName, String schemaName, String tableName)
conn
- Connection to usecatalogName
- CatalogschemaName
- SchematableName
- Name of the tableprotected RDBMSColumnInfo getRDBMSColumnInfoForColumn(Connection conn, Table table, String columnName)
conn
- Connection to usetable
- The tablecolumnName
- Name of the columnCopyright © 2020. All rights reserved.