public abstract class AbstractStoreSchemaHandler extends Object implements StoreSchemaHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoCreateColumns
Whether to auto create any columns that are missing.
|
protected boolean |
autoCreateConstraints
Whether to auto create any constraints
|
protected boolean |
autoCreateDatabase
Whether to auto create any database (catalog/schema).
|
protected boolean |
autoCreateTables
Whether to auto create any tables.
|
protected boolean |
autoCreateWarnOnError
Whether to warn only when any errors occur on auto-create.
|
protected boolean |
autoDeleteColumns
Whether to auto delete any columns that are present but not in the metadata.
|
protected StoreManager |
storeMgr |
protected boolean |
validateColumns
Whether to validate any columns
|
protected boolean |
validateConstraints
Whether to validate any constraints
|
protected boolean |
validateTables
Whether to validate any tables
|
Constructor and Description |
---|
AbstractStoreSchemaHandler(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)
Method to create the specified database (catalog/schema).
|
void |
createSchemaForClasses(Set<String> classNames,
Properties props,
Object connection)
Method to generate the required schema for the supplied classes.
|
void |
deleteDatabase(String catalogName,
String schemaName,
Properties props,
Object connection)
Method to delete the specified database (catalog/schema).
|
void |
deleteSchemaForClasses(Set<String> classNames,
Properties props,
Object connection)
Method to delete the schema for the supplied classes.
|
StoreSchemaData |
getSchemaData(Object connection,
String name,
Object[] values)
Accessor for schema data store under the provided name and defined by the specified values.
|
StoreManager |
getStoreManager() |
boolean |
isAutoCreateColumns() |
boolean |
isAutoCreateConstraints() |
boolean |
isAutoCreateDatabase() |
boolean |
isAutoCreateTables() |
boolean |
isAutoCreateWarnOnError() |
boolean |
isAutoDeleteColumns() |
boolean |
isValidateColumns() |
boolean |
isValidateConstraints() |
boolean |
isValidateTables() |
void |
validateSchema(Set<String> classNames,
Properties props,
Object connection)
Method to validate the schema for the supplied classes.
|
protected StoreManager storeMgr
protected final boolean autoCreateDatabase
protected final boolean autoCreateTables
protected final boolean autoCreateColumns
protected final boolean autoCreateConstraints
protected final boolean autoCreateWarnOnError
protected final boolean autoDeleteColumns
protected final boolean validateTables
protected final boolean validateColumns
protected final boolean validateConstraints
public AbstractStoreSchemaHandler(StoreManager storeMgr)
public StoreManager getStoreManager()
getStoreManager
in interface StoreSchemaHandler
public boolean isAutoCreateDatabase()
isAutoCreateDatabase
in interface StoreSchemaHandler
public boolean isAutoCreateTables()
isAutoCreateTables
in interface StoreSchemaHandler
public boolean isAutoCreateColumns()
isAutoCreateColumns
in interface StoreSchemaHandler
public boolean isAutoCreateConstraints()
isAutoCreateConstraints
in interface StoreSchemaHandler
public boolean isAutoCreateWarnOnError()
isAutoCreateWarnOnError
in interface StoreSchemaHandler
public boolean isAutoDeleteColumns()
isAutoDeleteColumns
in interface StoreSchemaHandler
public boolean isValidateTables()
isValidateTables
in interface StoreSchemaHandler
public boolean isValidateColumns()
isValidateColumns
in interface StoreSchemaHandler
public boolean isValidateConstraints()
isValidateConstraints
in interface StoreSchemaHandler
public void clear()
StoreSchemaHandler
clear
in interface StoreSchemaHandler
public void createDatabase(String catalogName, String schemaName, Properties props, Object connection)
StoreSchemaHandler
createDatabase
in interface StoreSchemaHandler
catalogName
- Name of the catalogschemaName
- Name of the schemaprops
- Any properties controlling the schema generationconnection
- Connection to use (null implies this will obtain its own connection)public void deleteDatabase(String catalogName, String schemaName, Properties props, Object connection)
StoreSchemaHandler
deleteDatabase
in interface StoreSchemaHandler
catalogName
- Name of the catalogschemaName
- Name of the schemaprops
- Any properties controlling the schema deletionconnection
- Connection to use (null implies this will obtain its own connection)public void createSchemaForClasses(Set<String> classNames, Properties props, Object connection)
StoreSchemaHandler
createSchemaForClasses
in interface StoreSchemaHandler
classNames
- Names of the classes we want the schema generating for.props
- Any properties controlling the schema generationconnection
- Connection to use (null implies this will obtain its own connection)public void deleteSchemaForClasses(Set<String> classNames, Properties props, Object connection)
StoreSchemaHandler
deleteSchemaForClasses
in interface StoreSchemaHandler
classNames
- Names of the classes we want the schema deleting for.props
- Any properties controlling the schema deletionconnection
- Connection to use (null implies this will obtain its own connection)public void validateSchema(Set<String> classNames, Properties props, Object connection)
StoreSchemaHandler
validateSchema
in interface StoreSchemaHandler
classNames
- Names of classesprops
- Any properties controlling schema validationconnection
- Connection to use (null implies this will obtain its own connection)public StoreSchemaData getSchemaData(Object connection, String name, Object[] values)
StoreSchemaHandler
getSchemaData
in interface 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 componentCopyright © 2019. All rights reserved.