public class RDBMSSchemaHandler extends Object implements org.datanucleus.store.schema.StoreSchemaHandler
Modifier and Type | Field and Description |
---|---|
protected long |
COLUMN_INFO_EXPIRATION_MS
Time within which column info is valid (millisecs).
|
protected static org.datanucleus.util.Localiser |
LOCALISER
Localiser for messages.
|
protected Map<String,org.datanucleus.store.schema.StoreSchemaData> |
schemaDataByName
Map of schema data, keyed by its symbolic name where the data is cached.
|
protected RDBMSStoreManager |
storeMgr |
Constructor and Description |
---|
RDBMSSchemaHandler(RDBMSStoreManager storeMgr) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Method to clear out any cached schema information.
|
void |
createSchema(Object connection,
String schemaName)
Method to create the schema with the supplied name.
|
void |
deleteSchema(Object connection,
String schemaName)
Method to delete the schema with the supplied name.
|
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 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.
|
org.datanucleus.store.StoreManager |
getStoreManager()
Accessor for the StoreManager we handle the schema for.
|
String |
getTableType(Connection conn,
Table table)
Returns the type of a database table/view in the datastore.
|
protected static final org.datanucleus.util.Localiser LOCALISER
protected final long COLUMN_INFO_EXPIRATION_MS
protected final RDBMSStoreManager storeMgr
public RDBMSSchemaHandler(RDBMSStoreManager storeMgr)
public void clear()
clear
in interface org.datanucleus.store.schema.StoreSchemaHandler
public void createSchema(Object connection, String schemaName)
createSchema
in interface org.datanucleus.store.schema.StoreSchemaHandler
connection
- Connection to the datastoreschemaName
- Name of the schemapublic void deleteSchema(Object connection, String schemaName)
deleteSchema
in interface org.datanucleus.store.schema.StoreSchemaHandler
connection
- Connection to the datastoreschemaName
- Name of the schemapublic org.datanucleus.store.schema.StoreSchemaData getSchemaData(Object connection, String name, Object[] values)
getSchemaData
in interface org.datanucleus.store.schema.StoreSchemaHandler
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 org.datanucleus.store.StoreManager getStoreManager()
getStoreManager
in interface org.datanucleus.store.schema.StoreSchemaHandler
public String getTableType(Connection conn, Table table) throws SQLException
conn
- Connection to the database.table
- The table/vieworg.datanucleus.exceptions.NucleusDataStoreException
- if an error occurs obtaining the informationSQLException
protected RDBMSTypesInfo getRDBMSTypesInfo(Connection conn)
conn
- Connection to the datastoreprotected 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 © 2023. All rights reserved.