public interface DatastoreAdapter
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_PARENTQUERY_IN_SUBQUERY_JOINED
Whether this database supports joining outer and inner queries using columns.
|
static String |
ALLOW_TABLE_ALIAS_IN_UPDATE_SET_CLAUSE |
static String |
ALTER_TABLE_DROP_CONSTRAINT_SYNTAX
Whether this datastore supports ALTER TABLE DROP constraints
|
static String |
ALTER_TABLE_DROP_FOREIGN_KEY_CONSTRAINT
Whether this datastore supports ALTER TABLE DROP FOREIGN KEY constraints
|
static String |
ANALYSIS_METHODS
Accessor for whether the SQL extensions CUBE, ROLLUP are supported.
|
static String |
ANSI_CROSSJOIN_SYNTAX
Accessor for whether the RDBMS supports ANSI cross-join syntax.
|
static String |
ANSI_JOIN_SYNTAX
Accessor for whether the RDBMS supports ANSI join syntax.
|
static String |
AUTO_INCREMENT_COLUMN_TYPE_SPECIFICATION
Whether we support auto-increment/identity keys with column type specification.
|
static String |
AUTO_INCREMENT_KEYS_NULL_SPECIFICATION
Whether we support auto-increment/identity keys with nullability specification.
|
static String |
AUTO_INCREMENT_PK_IN_CREATE_TABLE_COLUMN_DEF
Whether this adapter requires any specification of primary key in the column definition of CREATE TABLE.
|
static String |
BIT_IS_REALLY_BOOLEAN
Whether "Types.BIT" is really mapped as BOOLEAN.
|
static String |
BLOB_SET_USING_SETSTRING
Accessor for whether setting a BLOB value allows use of PreparedStatement.setString()
|
static String |
BOOLEAN_COMPARISON
Whether we support Boolean comparisons.
|
static String |
CATALOGS_IN_TABLE_DEFINITIONS
Whether this datastore supports the use of the catalog name in ORM table definitions (DDL).
|
static String |
CHAR_COLUMNS_PADDED_WITH_SPACES
Some databases store character strings in CHAR(XX) columns and when read back in have been padded
with spaces.
|
static String |
CHECK_IN_CREATE_STATEMENTS
Whether this datastore supports the use of "CHECK" in CREATE TABLE statements (DDL).
|
static String |
CHECK_IN_END_CREATE_STATEMENTS
Whether this datastore supports the use of CHECK after the column definitions in the
CREATE TABLE statements (DDL).
|
static String |
CLOB_SET_USING_SETSTRING
Accessor for whether setting a CLOB value allows use of PreparedStatement.setString()
|
static String |
CREATE_INDEXES_BEFORE_FOREIGN_KEYS
Whether to create indexes before foreign keys.
|
static String |
CROSSJOIN_ASINNER11_SYNTAX
Accessor for whether the RDBMS supports cross-join as "INNER 1=1" syntax.
|
static String |
DATETIME_STORES_MILLISECS
Whether DATETIME stores milliseconds.
|
static String |
DEFAULT_BEFORE_NULL_IN_COLUMN_OPTIONS
Whether any DEFAULT tag will be before any NULL/NOT NULL in the column options.
|
static String |
DEFAULT_KEYWORD_IN_COLUMN_OPTIONS
Whether we support DEFAULT tag in CREATE TABLE statements
|
static String |
DEFAULT_KEYWORD_WITH_NOT_NULL_IN_COLUMN_OPTIONS
Whether we support DEFAULT tag together with NOT NULL in CREATE TABLE statements.
|
static String |
DEFERRED_CONSTRAINTS
Whether this datastore supports deferred constraints.
|
static String |
DISTINCT_WITH_SELECT_FOR_UPDATE
Whether this datastore supports using DISTINCT when using SELECT ...
|
static String |
ESCAPE_EXPRESSION_IN_LIKE_PREDICATE |
static String |
EXISTS_SYNTAX
Whether the RDBMS supports use of EXISTS syntax.
|
static String |
FK_DELETE_ACTION_CASCADE |
static String |
FK_DELETE_ACTION_DEFAULT |
static String |
FK_DELETE_ACTION_NULL |
static String |
FK_DELETE_ACTION_RESTRICT |
static String |
FK_IN_END_CREATE_STATEMENTS
Whether this datastore supports the use of FOREIGN KEY after the column
definitions in CREATE TABLE statements (DDL).
|
static String |
FK_UPDATE_ACTION_CASCADE |
static String |
FK_UPDATE_ACTION_DEFAULT |
static String |
FK_UPDATE_ACTION_NULL |
static String |
FK_UPDATE_ACTION_RESTRICT |
static String |
GET_GENERATED_KEYS_STATEMENT
Whether the datastore supports "Statement.getGeneratedKeys".
|
static String |
HOLD_CURSORS_OVER_COMMIT |
static String |
IDENTIFIERS_LOWERCASE |
static String |
IDENTIFIERS_LOWERCASE_QUOTED |
static String |
IDENTIFIERS_MIXEDCASE |
static String |
IDENTIFIERS_MIXEDCASE_QUOTED |
static String |
IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE |
static String |
IDENTIFIERS_MIXEDCASE_SENSITIVE |
static String |
IDENTIFIERS_UPPERCASE |
static String |
IDENTIFIERS_UPPERCASE_QUOTED |
static String |
IDENTITY_COLUMNS
Whether this datastore adapter support identity fields.
|
static String |
INCLUDE_ORDERBY_COLS_IN_SELECT
Whether to include any ORDER BY columns in a SELECT.
|
static String |
LOCK_OPTION_PLACED_AFTER_FROM
Whether the lock option (when doing SELECT FOR UPDATE) is to be placed after the FROM.
|
static String |
LOCK_OPTION_PLACED_WITHIN_JOIN
Whether the lock option (when doing SELECT FOR UPDATE) is to be placed within the JOIN clause.
|
static String |
LOCK_WITH_SELECT_FOR_UPDATE
Whether this datastore supports SELECT ...
|
static String |
NULL_EQUALS_EMPTY_STRING
Some databases, Oracle, treats an empty string (0 length) equals null.
|
static String |
NULLS_IN_CANDIDATE_KEYS
Whether we support NULLs in candidate keys.
|
static String |
NULLS_KEYWORD_IN_COLUMN_OPTIONS
Whether the database support NULLs in the column options for table creation.
|
static String |
ORDERBY_NULLS_DIRECTIVES
Whether we support NULLS directives in ORDER expressions.
|
static String |
ORDERBY_USING_SELECT_COLUMN_INDEX
In SAPDB any orderby has to be using the index(es) of any SELECT column(s) rather than
their name(s).
|
static String |
PERSIST_OF_UNASSIGNED_CHAR
Whether the database server supports persist of an unassigned character ("0x0").
|
static String |
PRIMARYKEY_IN_CREATE_STATEMENTS
Whether the datastore supports specification of the primary key in CREATE TABLE statements.
|
static String |
PROJECTION_IN_TABLE_REFERENCE_JOINS
Whether this datastore supports "SELECT a.* FROM (SELECT * FROM TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a"
If the database does not support the SQL statement generated is like
"SELECT a.* FROM (TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a"
|
static String |
RESULTSET_TYPE_FORWARD_ONLY |
static String |
RESULTSET_TYPE_SCROLL_INSENSITIVE |
static String |
RESULTSET_TYPE_SCROLL_SENSITIVE |
static String |
SCHEMAS_IN_TABLE_DEFINITIONS
Whether this datastore supports the use of the schema name in ORM table definitions (DDL).
|
static String |
SEQUENCES
Whether we support sequences.
|
static String |
STATEMENT_BATCHING
Whether this datastore supports batching of statements.
|
static String |
STORED_PROCEDURES
Whether this datastore supports stored procedures.
|
static String |
TX_ISOLATION_NONE |
static String |
TX_ISOLATION_READ_COMMITTED |
static String |
TX_ISOLATION_READ_UNCOMMITTED |
static String |
TX_ISOLATION_REPEATABLE_READ |
static String |
TX_ISOLATION_SERIALIZABLE |
static String |
UNION_SYNTAX
Whether the RDBMS supports UNION syntax.
|
static String |
UNIQUE_IN_END_CREATE_STATEMENTS
Whether this datastore supports the use of UNIQUE after the column
definitions in CREATE TABLE statements (DDL).
|
static String |
USE_UNION_ALL
Union combines the results of two or more queries into a single result set.
|
static String |
VIEWS
Whether the RDBMS supports SQL VIEWs.
|
Modifier and Type | Method and Description |
---|---|
long |
getAdapterTime(Timestamp time)
Utility to return the adapter time in case there are rounding issues with millisecs etc.
|
String |
getAddCandidateKeyStatement(CandidateKey ck,
IdentifierFactory factory)
Returns the appropriate SQL to add a candidate key to its table.
|
String |
getAddColumnStatement(Table table,
Column col)
Accessor for the SQL statement to add a column to a table.
|
String |
getAddForeignKeyStatement(ForeignKey fk,
IdentifierFactory factory)
Returns the appropriate SQL to add a foreign key to its table.
|
String |
getAddPrimaryKeyStatement(PrimaryKey pk,
IdentifierFactory factory)
Returns the appropriate SQL to add a primary key to its table.
|
Class |
getAutoIncrementJavaTypeForType(Class type)
Return the java type that represents any autoincrement/identity column value.
|
String |
getAutoIncrementKeyword()
Accessor for the auto-increment/identity keyword for generating DDLs.
|
String |
getAutoIncrementStmt(Table table,
String columnName)
Accessor for the auto-increment/identity sql statement for this datastore.
|
String |
getCatalogName(Connection conn)
Accessor for the Catalog Name for this datastore.
|
String |
getCatalogSeparator()
Accessor for the catalog separator (string to separate the catalog/schema and the identifier).
|
String |
getCheckConstraintForValues(DatastoreIdentifier identifier,
Object[] values,
boolean nullable)
Creates a CHECK constraint definition based on the given values
e.g.
|
ResultSet |
getColumns(Connection conn,
String catalog,
String schema,
String table,
String columnNamePattern)
Accessor for table and column information for a catalog/schema in this datastore.
|
String |
getCreateDatabaseStatement(String catalogName,
String schemaName)
Method to return the statement necessary to create a database with this RDBMS.
|
String |
getCreateIndexStatement(Index idx,
IdentifierFactory factory)
Returns the appropriate SQL to add an index to its table.
|
String |
getCreateTableStatement(TableImpl table,
Column[] columns,
Properties props,
IdentifierFactory factory)
Returns the appropriate SQL to create the given table having the given
columns.
|
String |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date.
|
String |
getDatastoreDriverName()
Accessor for the datastore driver name.
|
String |
getDatastoreDriverVersion()
Accessor for the datastore driver version.
|
int |
getDatastoreIdentifierMaxLength(IdentifierType identifierType)
Method to return the maximum length of a datastore identifier of the specified type.
|
String |
getDatastoreProductName()
Accessor for the datastore product name.
|
String |
getDatastoreProductVersion()
Accessor for the datastore product version.
|
String |
getDeleteTableStatement(SQLTable tbl)
Method to return the basic SQL for a DELETE TABLE statement.
|
int |
getDriverMajorVersion()
Accessor for the driver major version
|
int |
getDriverMinorVersion()
Accessor for the driver minor version
|
String |
getDropDatabaseStatement(String catalogName,
String schemaName)
Method to return the statement necessary to drop a database with this RDBMS.
|
String |
getDropTableStatement(Table table)
Returns the appropriate SQL to drop the given table.
|
String |
getDropViewStatement(ViewImpl view)
Returns the appropriate SQL to drop the given view.
|
String |
getEscapeCharacter()
The character for escaping characters in pattern expressions.
|
String |
getEscapePatternExpression()
The character for escaping characters in pattern expressions.
|
ResultSet |
getExistingIndexes(Connection conn,
String catalog,
String schema,
String table)
Provide the existing indexes in the database for the table
|
String |
getIdentifierQuoteString()
Accessor for the quote string to use when quoting identifiers.
|
String |
getInsertStatementForNoColumns(Table table)
Method to retutn the INSERT statement to use when inserting into a table that has no
columns specified.
|
int |
getJDBCTypeForName(String typeName)
Method to return the type given the "jdbc-type" name.
|
MappingManager |
getMappingManager(RDBMSStoreManager storeMgr)
Accessor for a Mapping Manager suitable for use with this datastore adapter.
|
int |
getMaxForeignKeys()
Accessor for the maximum foreign keys by table permitted in this datastore.
|
int |
getMaxIndexes()
Accessor for the maximum indexes by table permitted in this datastore.
|
String |
getNameForJDBCType(int jdbcType)
Return a name for a JDBC Types value.
|
String |
getNumericConversionFunction()
Accessor for the function to use for converting to numeric.
|
String |
getOrderString(org.datanucleus.store.StoreManager storeMgr,
String orderString,
SQLExpression sqlExpr)
Convenience method to allow adaption of an ordering string before applying it.
|
String |
getPatternExpressionAnyCharacter()
The pattern string for representing one character that is expanded in word searches.
|
String |
getPatternExpressionZeroMoreCharacters()
The pattern string for representing zero or more characters that is expanded in word searches.
|
String |
getRangeByLimitEndOfStatementClause(long offset,
long count)
Method to return the SQL to append to the end of the SELECT statement to handle
restriction of ranges using the LIMIT keyword.
|
String |
getRangeByRowNumberColumn()
Method to return the column name to use when handling ranges via
a rownumber on the select using the original method (DB2).
|
String |
getRangeByRowNumberColumn2()
Method to return the column name to use when handling ranges via
a rownumber on the select using the second method (Oracle).
|
int |
getRequiredTransactionIsolationLevel()
Accessor for the "required" transaction isolation level if it has to be a certain value
for this adapter.
|
String |
getSchemaName(Connection conn)
Accessor for the Schema Name for this datastore.
|
String |
getSelectForUpdateText()
Method returning the text to append to the end of the SELECT to perform the equivalent
of "SELECT ...
|
String |
getSelectNewUUIDStmt()
The function to creates a unique value of type uniqueidentifier.
|
String |
getSelectWithLockOption()
The option to specify in "SELECT ...
|
String |
getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
Accessor for the sequence create statement for this datastore.
|
String |
getSequenceNextStmt(String sequence_name)
Accessor for the sequence statement to get the next id for this
datastore.
|
Collection<String> |
getSupportedOptions()
Accessor for the options that are supported by this datastore adapter and the underlying datastore.
|
String |
getSurrogateForEmptyStrings()
Some databases, Oracle, treats an empty string (0 length) equals null
|
int |
getTransactionIsolationForSchemaCreation()
Accessor for the transaction isolation level to use during schema creation.
|
int |
getUnlimitedLengthPrecisionValue(SQLTypeInfo typeInfo)
Returns the precision value to be used when creating string columns of "unlimited" length.
|
SQLText |
getUpdateTableStatement(SQLTable tbl,
SQLText setSQL)
Method to return the basic SQL for an UPDATE TABLE statement.
|
String |
getVendorID()
Accessor for the Vendor ID for this datastore.
|
void |
initialiseDatastore(Object conn)
Creates the auxiliary functions/procedures in the datastore
|
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Initialise the types for this datastore.
|
boolean |
isIdentityFieldDataType(String columnDef)
Verifies if the given
columnDef is an identity field type for the datastore. |
boolean |
isReservedKeyword(String word)
Method to check if a word is reserved for this datastore.
|
boolean |
isStatementCancel(SQLException sqle)
return whether this exception represents a cancelled statement.
|
boolean |
isStatementTimeout(SQLException sqle)
return whether this exception represents a timed out statement.
|
boolean |
isValidPrimaryKeyType(org.datanucleus.metadata.JdbcType datatype)
Method to return whether the specified JDBC type is valid for use in a PrimaryKey.
|
Iterator |
iteratorReservedWords()
Iterator for the reserved words constructed from the method
DataBaseMetaData.getSQLKeywords + standard SQL reserved words
|
ForeignKeyInfo |
newFKInfo(ResultSet rs)
Method to return ForeignKeyInfo for the current row of the ResultSet which will have been
obtained from a call to DatabaseMetaData.getImportedKeys() or DatabaseMetaData.getExportedKeys().
|
RDBMSColumnInfo |
newRDBMSColumnInfo(ResultSet rs)
Create a new column info from the current row of the passed ResultSet.
|
SQLTypeInfo |
newSQLTypeInfo(ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet.
|
void |
removeUnsupportedMappings(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Remove all mappings from the mapping manager that don't have a datastore type initialised.
|
boolean |
sequenceExists(Connection conn,
String catalogName,
String schemaName,
String seqName)
Convenience method to return whether the specified sequence already exists.
|
void |
setProperties(Map<String,Object> props)
Set any properties controlling how the adapter is configured.
|
boolean |
supportsOption(String option)
Accessor for whether the supplied option is supported.
|
boolean |
supportsQueryFetchSize(int size)
Whether the datastore will support setting the query fetch size to the supplied value.
|
boolean |
supportsTransactionIsolation(int level)
Accessor for whether this database adapter supports the specified transaction isolation.
|
String |
toString()
Method to return this object as a string.
|
boolean |
validToSelectMappingInStatement(SQLStatement stmt,
JavaTypeMapping m)
Method to return if it is valid to select the specified mapping for the specified statement
for this datastore adapter.
|
static final String IDENTITY_COLUMNS
static final String SEQUENCES
static final String BIT_IS_REALLY_BOOLEAN
static final String BOOLEAN_COMPARISON
static final String ESCAPE_EXPRESSION_IN_LIKE_PREDICATE
static final String PROJECTION_IN_TABLE_REFERENCE_JOINS
static final String ANALYSIS_METHODS
static final String CATALOGS_IN_TABLE_DEFINITIONS
static final String SCHEMAS_IN_TABLE_DEFINITIONS
static final String IDENTIFIERS_LOWERCASE
static final String IDENTIFIERS_MIXEDCASE
static final String IDENTIFIERS_UPPERCASE
static final String IDENTIFIERS_LOWERCASE_QUOTED
static final String IDENTIFIERS_MIXEDCASE_QUOTED
static final String IDENTIFIERS_UPPERCASE_QUOTED
static final String IDENTIFIERS_MIXEDCASE_SENSITIVE
static final String IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE
static final String VIEWS
static final String UNION_SYNTAX
static final String USE_UNION_ALL
static final String EXISTS_SYNTAX
static final String ALTER_TABLE_DROP_CONSTRAINT_SYNTAX
static final String ALTER_TABLE_DROP_FOREIGN_KEY_CONSTRAINT
static final String DEFERRED_CONSTRAINTS
static final String DISTINCT_WITH_SELECT_FOR_UPDATE
static final String ALLOW_TABLE_ALIAS_IN_UPDATE_SET_CLAUSE
static final String PERSIST_OF_UNASSIGNED_CHAR
static final String CHAR_COLUMNS_PADDED_WITH_SPACES
static final String NULL_EQUALS_EMPTY_STRING
static final String STATEMENT_BATCHING
static final String CHECK_IN_CREATE_STATEMENTS
static final String CHECK_IN_END_CREATE_STATEMENTS
CREATE TABLE MYTABLE ( COL_A int, COL_B char(1), PRIMARY KEY (COL_A), CHECK (COL_B IN ('Y','N')) )
static final String UNIQUE_IN_END_CREATE_STATEMENTS
CREATE TABLE MYTABLE ( COL_A int, COL_B char(1), PRIMARY KEY (COL_A), UNIQUE (COL_B ...) )
static final String FK_IN_END_CREATE_STATEMENTS
CREATE TABLE MYTABLE ( COL_A int, COL_B char(1), FOREIGN KEY (COL_A) REFERENCES TBL2(COL_X) )
static final String PRIMARYKEY_IN_CREATE_STATEMENTS
static final String GET_GENERATED_KEYS_STATEMENT
static final String NULLS_IN_CANDIDATE_KEYS
static final String NULLS_KEYWORD_IN_COLUMN_OPTIONS
static final String DEFAULT_KEYWORD_IN_COLUMN_OPTIONS
static final String DEFAULT_KEYWORD_WITH_NOT_NULL_IN_COLUMN_OPTIONS
CREATE TABLE X ( MEMORY_SIZE BIGINT DEFAULT 0 NOT NULL )Some databases only support DEFAULT {ConstantExpression | NULL}
static final String DEFAULT_BEFORE_NULL_IN_COLUMN_OPTIONS
static final String ANSI_JOIN_SYNTAX
static final String ANSI_CROSSJOIN_SYNTAX
static final String CROSSJOIN_ASINNER11_SYNTAX
static final String AUTO_INCREMENT_KEYS_NULL_SPECIFICATION
static final String AUTO_INCREMENT_COLUMN_TYPE_SPECIFICATION
static final String AUTO_INCREMENT_PK_IN_CREATE_TABLE_COLUMN_DEF
static final String LOCK_WITH_SELECT_FOR_UPDATE
static final String LOCK_OPTION_PLACED_AFTER_FROM
static final String LOCK_OPTION_PLACED_WITHIN_JOIN
static final String BLOB_SET_USING_SETSTRING
static final String CLOB_SET_USING_SETSTRING
static final String CREATE_INDEXES_BEFORE_FOREIGN_KEYS
static final String INCLUDE_ORDERBY_COLS_IN_SELECT
static final String DATETIME_STORES_MILLISECS
static final String ACCESS_PARENTQUERY_IN_SUBQUERY_JOINED
static final String ORDERBY_USING_SELECT_COLUMN_INDEX
static final String ORDERBY_NULLS_DIRECTIVES
static final String STORED_PROCEDURES
static final String FK_UPDATE_ACTION_CASCADE
static final String FK_UPDATE_ACTION_DEFAULT
static final String FK_UPDATE_ACTION_NULL
static final String FK_UPDATE_ACTION_RESTRICT
static final String FK_DELETE_ACTION_CASCADE
static final String FK_DELETE_ACTION_DEFAULT
static final String FK_DELETE_ACTION_NULL
static final String FK_DELETE_ACTION_RESTRICT
static final String TX_ISOLATION_NONE
static final String TX_ISOLATION_READ_COMMITTED
static final String TX_ISOLATION_READ_UNCOMMITTED
static final String TX_ISOLATION_REPEATABLE_READ
static final String TX_ISOLATION_SERIALIZABLE
static final String RESULTSET_TYPE_FORWARD_ONLY
static final String RESULTSET_TYPE_SCROLL_SENSITIVE
static final String RESULTSET_TYPE_SCROLL_INSENSITIVE
static final String HOLD_CURSORS_OVER_COMMIT
Collection<String> getSupportedOptions()
boolean supportsOption(String option)
option
- The optionString getNameForJDBCType(int jdbcType)
jdbcType
- The jdbc typeint getJDBCTypeForName(String typeName)
typeName
- "jdbc-type" nameMappingManager getMappingManager(RDBMSStoreManager storeMgr)
storeMgr
- The StoreManagerString getVendorID()
void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler, org.datanucleus.store.connection.ManagedConnection mconn)
handler
- SchemaHandler that we initialise the types formconn
- Managed connection to usevoid setProperties(Map<String,Object> props)
props
- The propertiesvoid removeUnsupportedMappings(org.datanucleus.store.schema.StoreSchemaHandler handler, org.datanucleus.store.connection.ManagedConnection mconn)
handler
- Schema handlermconn
- Managed connection to useboolean isReservedKeyword(String word)
word
- The wordvoid initialiseDatastore(Object conn)
conn
- the connection to the datastoreString getIdentifierQuoteString()
String getCatalogSeparator()
long getAdapterTime(Timestamp time)
time
- The timestampString getDatastoreProductName()
String getDatastoreProductVersion()
String getDatastoreDriverName()
String getDatastoreDriverVersion()
int getDriverMajorVersion()
int getDriverMinorVersion()
boolean isIdentityFieldDataType(String columnDef)
columnDef
is an identity field type for the datastore.columnDef
- the datastore type namecolumnDef
has values for identity generation in the datastoreint getDatastoreIdentifierMaxLength(IdentifierType identifierType)
identifierType
- Type of identifierClass getAutoIncrementJavaTypeForType(Class type)
type
- The type of the member mapping to an IDENTITY columnint getMaxForeignKeys()
int getMaxIndexes()
boolean supportsQueryFetchSize(int size)
size
- The value to set toString toString()
boolean supportsTransactionIsolation(int level)
level
- The isolation level (as defined by Connection enums).String getRangeByLimitEndOfStatementClause(long offset, long count)
offset
- The offset to return fromcount
- The number of items to returnString getRangeByRowNumberColumn()
String getRangeByRowNumberColumn2()
ResultSet getColumns(Connection conn, String catalog, String schema, String table, String columnNamePattern) throws SQLException
conn
- Connection to usecatalog
- The catalog (null if none)schema
- The schema (null if none)table
- The table (null if all)columnNamePattern
- The column name (null if all)SQLException
- Thrown if an error occursString getInsertStatementForNoColumns(Table table)
table
- The tableint getUnlimitedLengthPrecisionValue(SQLTypeInfo typeInfo)
typeInfo
- the typeInfo object for which the precision value is needed.String getAutoIncrementStmt(Table table, String columnName)
table
- Table (that the autoincrement is for)columnName
- (that the autoincrement is for)String getAutoIncrementKeyword()
String getCreateDatabaseStatement(String catalogName, String schemaName)
catalogName
- name of the catalogschemaName
- Name of the schemaString getDropDatabaseStatement(String catalogName, String schemaName)
catalogName
- Name of the catalogschemaName
- Name of the schemaString getDropTableStatement(Table table)
DROP TABLE FOO CASCADE
table
- The table to drop.String getDeleteTableStatement(SQLTable tbl)
DELETE FROM tbl t1. Doesn't include any where clause.
tbl
- The SQLTable to deleteSQLText getUpdateTableStatement(SQLTable tbl, SQLText setSQL)
UPDATE tbl t1 SET x1 = val1. Doesn't include any WHERE clause.
tbl
- The SQLTable to updatesetSQL
- The SQLText for the SET componentString getAddCandidateKeyStatement(CandidateKey ck, IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ)
ck
- An object describing the candidate key.factory
- Identifier factoryboolean isValidPrimaryKeyType(org.datanucleus.metadata.JdbcType datatype)
datatype
- The JDBC type.String getAddColumnStatement(Table table, Column col)
table
- The tablecol
- The columnString getCreateIndexStatement(Index idx, IdentifierFactory factory)
CREATE INDEX FOO_N1 ON FOO (BAR,BAZ) CREATE UNIQUE INDEX FOO_U1 ON FOO (BAR,BAZ)
idx
- An object describing the index.factory
- Identifier factoryResultSet getExistingIndexes(Connection conn, String catalog, String schema, String table) throws SQLException
conn
- the JDBC connectioncatalog
- the catalog nameschema
- the schema nametable
- the table nameSQLException
- if an error occursString getCreateTableStatement(TableImpl table, Column[] columns, Properties props, IdentifierFactory factory)
CREATE TABLE FOO (BAR VARCHAR(30), BAZ INTEGER)
table
- The table to create.columns
- The columns of the table.props
- Properties for controlling the table creationfactory
- Identifier factoryString getAddPrimaryKeyStatement(PrimaryKey pk, IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR)
pk
- An object describing the primary key.factory
- Identifier factoryString getAddForeignKeyStatement(ForeignKey fk, IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
fk
- An object describing the foreign key.factory
- Identifier factoryString getDropViewStatement(ViewImpl view)
DROP VIEW FOO
view
- The view to drop.String getSelectForUpdateText()
String getSurrogateForEmptyStrings()
int getTransactionIsolationForSchemaCreation()
int getRequiredTransactionIsolationLevel()
String getCatalogName(Connection conn) throws SQLException
conn
- Connection to the datastoreSQLException
- Thrown if error occurs in determining the
catalog name.String getSchemaName(Connection conn) throws SQLException
conn
- Connection to the datastoreSQLException
- Thrown if error occurs in determining the
schema name.String getSelectWithLockOption()
String getSelectNewUUIDStmt()
String getSequenceNextStmt(String sequence_name)
sequence_name
- Name of the sequenceString getSequenceCreateStmt(String sequence_name, Integer min, Integer max, Integer start, Integer increment, Integer cache_size)
sequence_name
- Name of the sequencemin
- Minimum value for the sequencemax
- Maximum value for the sequencestart
- Start value for the sequenceincrement
- Increment value for the sequencecache_size
- Cache size for the sequenceboolean sequenceExists(Connection conn, String catalogName, String schemaName, String seqName)
conn
- Connection to use for checkingcatalogName
- Catalog nameschemaName
- Schema nameseqName
- Name of the sequenceIterator iteratorReservedWords()
String getDatastoreDateStatement()
String getCheckConstraintForValues(DatastoreIdentifier identifier, Object[] values, boolean nullable)
CHECK ("COLUMN" IN ('VAL1','VAL2') OR "COLUMN" IS NULL)
identifier
- Column identifiervalues
- valid valuesnullable
- whether the datastore identifier is nullSQLTypeInfo newSQLTypeInfo(ResultSet rs)
rs
- ResultSetRDBMSColumnInfo newRDBMSColumnInfo(ResultSet rs)
rs
- Result SetForeignKeyInfo newFKInfo(ResultSet rs)
rs
- The result set returned from DatabaseMetaData.get??portedKeys()String getOrderString(org.datanucleus.store.StoreManager storeMgr, String orderString, SQLExpression sqlExpr)
storeMgr
- StoreManagerorderString
- The basic ordering stringsqlExpr
- The sql expression being represented hereboolean validToSelectMappingInStatement(SQLStatement stmt, JavaTypeMapping m)
stmt
- The statementm
- The mapping that we want to selectboolean isStatementCancel(SQLException sqle)
sqle
- the exceptionboolean isStatementTimeout(SQLException sqle)
sqle
- the exceptionString getNumericConversionFunction()
String getEscapePatternExpression()
String getEscapeCharacter()
String getPatternExpressionAnyCharacter()
String getPatternExpressionZeroMoreCharacters()
Copyright © 2015. All rights reserved.