|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
public class DatabaseAdapter
Provides methods for adapting SQL language elements to a specific vendor's database. A database adapter is primarily used to map generic JDBC data types and SQL identifiers to specific types/identifiers suitable for the database in use.
Each database adapter corresponds to a particular combination of database,
database version, driver, and driver version, as provided by the driver's
own metadata. Database adapters cannot be constructed directly, but must be
obtained using the RDBMSAdapterFactory class.
RDBMSAdapterFactory,
DatabaseMetaData| Field Summary | |
|---|---|
protected java.lang.String |
catalogSeparator
The String used to separate catalog and table name. |
protected int |
datastoreMajorVersion
The major version number of the underlying datastore. |
protected int |
datastoreMinorVersion
The minor version number of the underlying datastore. |
protected java.lang.String |
datastoreProductName
The product name of the underlying datastore. |
protected java.lang.String |
datastoreProductVersion
The version number of the underlying datastore as a string. |
protected int |
datastoreRevisionVersion
The revision version number of the underlying datastore. |
protected int |
driverMajorVersion
The major version number of the underlying driver. |
protected int |
driverMinorVersion
The minor version number of the underlying driver. |
protected java.lang.String |
driverName
the JDBC driver name |
protected java.lang.String |
driverVersion
the JDBC driver version |
protected java.lang.String |
identifierQuoteString
The String used to quote identifiers. |
protected static org.datanucleus.util.Localiser |
LOCALISER
|
protected static org.datanucleus.util.Localiser |
LOCALISER_BASE
|
protected int |
maxColumnNameLength
The maximum length to be used for a column name. |
protected int |
maxConstraintNameLength
The maximum length to be used for a table constraint name. |
protected int |
maxIndexNameLength
The maximum length to be used for an index name. |
protected int |
maxTableNameLength
The maximum length to be used for a table name. |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties
Optional properties controlling the configuration. |
protected java.util.HashSet<java.lang.String> |
reservedKeywords
The set of reserved keywords for this datastore. |
protected java.util.Collection<java.lang.String> |
supportedOptions
Supported option names. |
| Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter |
|---|
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES |
| Constructor Summary | |
|---|---|
protected |
DatabaseAdapter(java.sql.DatabaseMetaData metadata)
Constructs a database adapter based on the given JDBC metadata. |
| Method Summary | |
|---|---|
protected void |
addSQLTypeForJDBCType(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn,
short jdbcTypeNumber,
SQLTypeInfo sqlType,
boolean addIfNotPresent)
Convenience method for use by adapters to add their own fake JDBC/SQL types in where the JDBC driver doesn't provide some type. |
long |
getAdapterTime(java.sql.Timestamp time)
|
java.lang.String |
getAddCandidateKeyStatement(CandidateKey ck,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a candidate key to its table. |
java.lang.String |
getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
java.lang.String |
getAddForeignKeyStatement(ForeignKey fk,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a foreign key to its table. |
java.lang.String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a primary key to its table. |
java.lang.String |
getAutoIncrementKeyword()
Accessor for the autoincrementing keyword for generating DDLs. |
java.lang.String |
getAutoIncrementStmt(Table table,
java.lang.String columnName)
Accessor for the autoincrementing sql statement for this datastore. |
java.lang.String |
getCatalogName(java.sql.Connection conn)
Accessor for the Catalog Name for this datastore. |
java.lang.String |
getCatalogSeparator()
Accessor for the catalog separator. |
java.lang.String |
getCheckConstraintForValues(org.datanucleus.store.mapped.DatastoreIdentifier identifier,
java.lang.Object[] values,
boolean nullable)
Creates a CHECK constraint definition based on the given values e.g. |
java.sql.ResultSet |
getColumns(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String columnNamePattern)
Accessor for table and column information for a catalog/schema in this datastore. |
java.lang.String |
getContinuationString()
Continuation string to use where the SQL statement goes over more than 1 line. |
java.lang.String |
getCreateIndexStatement(Index idx,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate DDL to create an index. |
java.lang.String |
getCreateTableStatement(TableImpl table,
Column[] columns,
java.util.Properties props,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to create the given table having the given columns. |
java.lang.String |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date. |
java.lang.String |
getDatastoreDriverName()
|
java.lang.String |
getDatastoreDriverVersion()
|
int |
getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
Method to return the maximum length of a datastore identifier of the specified type. |
java.lang.String |
getDatastoreProductName()
|
java.lang.String |
getDatastoreProductVersion()
|
java.lang.String |
getDeleteTableStatement(SQLTable tbl)
Method to return the basic SQL for a DELETE TABLE statement. |
int |
getDriverMajorVersion()
Accessor for the JDBC driver major version |
int |
getDriverMinorVersion()
Accessor for the JDBC driver minor version |
java.lang.String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
java.lang.String |
getDropViewStatement(ViewImpl view)
Returns the appropriate SQL to drop the given view. |
java.lang.String |
getEscapeCharacter()
The character for escaping characters in pattern expressions. |
java.lang.String |
getEscapePatternExpression()
The character for escaping characters in pattern expressions. |
java.sql.ResultSet |
getExistingIndexes(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Provide the existing indexes in the database for the table. |
java.lang.String |
getIdentifierQuoteString()
Accessor for an identifier quote string. |
java.lang.String |
getInsertStatementForNoColumns(Table table)
Method to return the INSERT statement to use when inserting into a table that has no columns specified. |
org.datanucleus.store.mapped.mapping.MappingManager |
getMappingManager(org.datanucleus.store.mapped.MappedStoreManager storeMgr)
Accessor for a MappingManager suitable for use with this datastore adapter. |
int |
getMaxForeignKeys()
Accessor for the maximum foreign keys by table permitted for this datastore. |
int |
getMaxIndexes()
Accessor for the maximum indexes by schema permitted for this datastore. |
protected int |
getMiliseconds(long nanos)
|
java.lang.String |
getNewUUIDFunction()
The function to creates a unique value of type uniqueidentifier. |
java.lang.String |
getNumericConversionFunction()
Accessor for the function to use for converting to numeric. |
java.lang.String |
getOperatorConcat()
An operator in a string expression that concatenates two or more character or binary strings, columns, or a combination of strings and column names into one expression (a string operator). |
java.lang.String |
getOrderString(org.datanucleus.store.StoreManager storeMgr,
java.lang.String orderString,
SQLExpression sqlExpr)
Convenience method to allow adaption of an ordering string before applying it. |
java.lang.String |
getPatternExpressionAnyCharacter()
The pattern string for representing one character that is expanded in word searches. |
java.lang.String |
getPatternExpressionZeroMoreCharacters()
The pattern string for representing zero or more characters that is expanded in word searches. |
java.lang.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. |
java.lang.String |
getRangeByRowNumberColumn()
Method to return the column name to use when handling ranges via a rownumber on the select using the original method (DB2). |
java.lang.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. |
java.lang.String |
getSchemaName(java.sql.Connection conn)
Accessor for the Schema Name for this datastore. |
java.lang.String |
getSelectForUpdateText()
Method returning the text to append to the end of the SELECT to perform the equivalent of "SELECT ... |
java.lang.String |
getSelectNewUUIDStmt()
The function to creates a unique value of type uniqueidentifier. |
java.lang.String |
getSelectWithLockOption()
The option to specify in "SELECT ... |
java.lang.String |
getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Integer start,
java.lang.Integer increment,
java.lang.Integer cache_size)
Accessor for the sequence create statement for this datastore. |
java.lang.String |
getSequenceNextStmt(java.lang.String sequence_name)
Accessor for the sequence statement to get the next id for this datastore. |
protected java.util.Collection<SQLTypeInfo> |
getSQLTypeInfoForJdbcType(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn,
short jdbcTypeNumber)
Accessor for the SQLType info for the specified JDBC type and the SQL type name. |
java.util.Collection<java.lang.String> |
getSupportedOptions()
Accessor for the options that are supported by this datastore adapter and the underlying datastore. |
java.lang.String |
getSurrogateForEmptyStrings()
Some databases, Oracle, treats an empty string (0 length) equals null |
protected long |
getTime(long time,
long nanos)
|
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. |
java.lang.Object |
getValueForProperty(java.lang.String name)
Accessor for a property. |
java.lang.String |
getVendorID()
|
void |
initialiseDatastore(java.lang.Object conn)
Creates the auxiliary functions/procedures in the schema |
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Initialise the types for this datastore. |
boolean |
isIdentityFieldDataType(java.lang.String typeName)
Verifies if the given typeName is auto incremented by the datastore. |
boolean |
isKeyword(java.lang.String word)
Tests if a given string is a SQL key word. |
boolean |
isReservedKeyword(java.lang.String word)
Tests if a given string is a SQL keyword. |
boolean |
isStatementCancel(java.sql.SQLException sqle)
return whether this exception represents a cancelled statement. |
boolean |
isStatementTimeout(java.sql.SQLException sqle)
return whether this exception represents a timed out statement. |
boolean |
isValidPrimaryKeyType(int datatype)
Method to return whether the specified JDBC type is valid for use in a PrimaryKey. |
java.util.Iterator |
iteratorReservedWords()
Iterator for the reserved words constructed from the method DataBaseMetaData.getSQLKeywords + standard SQL reserved words |
ForeignKeyInfo |
newFKInfo(java.sql.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(java.sql.ResultSet rs)
Create a new column info from the current row of the passed ResultSet. |
SQLTypeInfo |
newSQLTypeInfo(java.sql.ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
protected java.util.Set |
parseKeywordList(java.lang.String list)
Utility method to parse a list of keywords and split them out into words. |
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. |
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Set any properties controlling how the adapter is configured. |
boolean |
supportsOption(java.lang.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. |
java.lang.String |
toString()
|
boolean |
validToSelectMappingInStatement(SQLStatement stmt,
org.datanucleus.store.mapped.mapping.JavaTypeMapping m)
Method to return if it is valid to select the specified mapping for the specified statement for this datastore adapter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER_BASE
protected static final org.datanucleus.util.Localiser LOCALISER
protected final java.util.HashSet<java.lang.String> reservedKeywords
protected java.lang.String datastoreProductName
protected java.lang.String datastoreProductVersion
protected int datastoreMajorVersion
protected int datastoreMinorVersion
protected int datastoreRevisionVersion
protected java.lang.String identifierQuoteString
protected java.util.Collection<java.lang.String> supportedOptions
protected java.lang.String driverName
protected java.lang.String driverVersion
protected int driverMajorVersion
protected int driverMinorVersion
protected int maxTableNameLength
protected int maxConstraintNameLength
protected int maxIndexNameLength
protected int maxColumnNameLength
protected java.lang.String catalogSeparator
protected java.util.Map<java.lang.String,java.lang.Object> properties
| Constructor Detail |
|---|
protected DatabaseAdapter(java.sql.DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public void initialiseDatastore(java.lang.Object conn)
initialiseDatastore in interface org.datanucleus.store.mapped.DatastoreAdapterconn - the connection to the datastore
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
setProperties in interface org.datanucleus.store.mapped.DatastoreAdapterprops - The propertiespublic java.lang.Object getValueForProperty(java.lang.String name)
name - Name of the property
public void removeUnsupportedMappings(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
removeUnsupportedMappings in interface org.datanucleus.store.mapped.DatastoreAdapterhandler - Schema handlermconn - Managed connection to use
protected java.util.Collection<SQLTypeInfo> getSQLTypeInfoForJdbcType(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn,
short jdbcTypeNumber)
handler - Schema handlermconn - ConnectionjdbcTypeNumber - JDBC type
protected void addSQLTypeForJDBCType(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn,
short jdbcTypeNumber,
SQLTypeInfo sqlType,
boolean addIfNotPresent)
handler - the schema handler managing the typesmconn - Connection to usejdbcTypeNumber - The JDBC typesqlType - The type info to useaddIfNotPresent - whether to add only if JDBC type not presentpublic boolean supportsTransactionIsolation(int level)
supportsTransactionIsolation in interface RDBMSAdapterlevel - The isolation level (as defined by Connection enums).
public java.util.Collection<java.lang.String> getSupportedOptions()
getSupportedOptions in interface org.datanucleus.store.mapped.DatastoreAdapterpublic boolean supportsOption(java.lang.String option)
supportsOption in interface org.datanucleus.store.mapped.DatastoreAdapteroption - The option
public org.datanucleus.store.mapped.mapping.MappingManager getMappingManager(org.datanucleus.store.mapped.MappedStoreManager storeMgr)
getMappingManager in interface org.datanucleus.store.mapped.DatastoreAdapterstoreMgr - The StoreManager
public long getAdapterTime(java.sql.Timestamp time)
getAdapterTime in interface org.datanucleus.store.mapped.DatastoreAdapter
protected long getTime(long time,
long nanos)
protected int getMiliseconds(long nanos)
public java.lang.String getDatastoreProductName()
getDatastoreProductName in interface org.datanucleus.store.mapped.DatastoreAdapterpublic java.lang.String getDatastoreProductVersion()
getDatastoreProductVersion in interface org.datanucleus.store.mapped.DatastoreAdapterpublic java.lang.String getDatastoreDriverName()
getDatastoreDriverName in interface org.datanucleus.store.mapped.DatastoreAdapterpublic java.lang.String getDatastoreDriverVersion()
getDatastoreDriverVersion in interface org.datanucleus.store.mapped.DatastoreAdapterpublic boolean supportsQueryFetchSize(int size)
supportsQueryFetchSize in interface org.datanucleus.store.mapped.DatastoreAdaptersize - The value to set to
public java.lang.String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdapterpublic boolean isReservedKeyword(java.lang.String word)
The list of key words tested against is defined to contain all SQL/92 keywords, plus any additional
key words reported by the JDBC driver for this adapter via DatabaseMetaData.getSQLKeywords().
In general, use of a SQL key word as an identifier should be avoided. SQL/92 key words are divided into reserved and non-reserved words. If a reserved word is used as an identifier it must be quoted with double quotes. Strictly speaking, the same is not true of non-reserved words. However, as C.J. Date writes in A Guide To The SQL Standard :
The rule by which it is determined within the standard that one key word needs to be reserved while another need not is not clear to this writer. In practice, it is probably wise to treat all key words as reserved.
isReservedKeyword in interface org.datanucleus.store.mapped.DatastoreAdapterword - The word to test.
true if word is a SQL key word for this DBMS.
The comparison is case-insensitive.SQLConstantspublic java.lang.String getIdentifierQuoteString()
getIdentifierQuoteString in interface org.datanucleus.store.mapped.DatastoreAdapterpublic int getDriverMajorVersion()
public int getDriverMinorVersion()
public int getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
getDatastoreIdentifierMaxLength in interface org.datanucleus.store.mapped.DatastoreAdapteridentifierType - Type of identifier (see IdentifierFactory.TABLE, etc)
public int getMaxForeignKeys()
getMaxForeignKeys in interface org.datanucleus.store.mapped.DatastoreAdapterpublic int getMaxIndexes()
getMaxIndexes in interface org.datanucleus.store.mapped.DatastoreAdapterpublic java.util.Iterator iteratorReservedWords()
iteratorReservedWords in interface RDBMSAdapterpublic RDBMSColumnInfo newRDBMSColumnInfo(java.sql.ResultSet rs)
RDBMSAdapter
newRDBMSColumnInfo in interface RDBMSAdapterrs - Result Set
public SQLTypeInfo newSQLTypeInfo(java.sql.ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapterrs - ResultSet
public ForeignKeyInfo newFKInfo(java.sql.ResultSet rs)
newFKInfo in interface RDBMSAdapterrs - The result set returned from DatabaseMetaData.get??portedKeys()
protected java.util.Set parseKeywordList(java.lang.String list)
list - The comma-separated list of keywords.
public boolean isKeyword(java.lang.String word)
The list of key words tested against is defined to contain all SQL/92 key
words, plus any additional key words reported by the JDBC driver for this
adapter via DatabaseMetaData.getSQLKeywords().
In general, use of a SQL key word as an identifier should be avoided. SQL/92 key words are divided into reserved and non-reserved words. If a reserved word is used as an identifier it must be quoted with double quotes. Strictly speaking, the same is not true of non-reserved words. However, as C.J. Date writes in A Guide To The SQL Standard :
The rule by which it is determined within the standard that one key word needs to be reserved while another need not is not clear to this writer. In practice, it is probably wise to treat all key words as reserved.
word - The word to test.
true if word is a SQL key word for
this DBMS. The comparison is case-insensitive.SQLConstantspublic int getUnlimitedLengthPrecisionValue(SQLTypeInfo typeInfo)
getUnlimitedLengthPrecisionValue in interface RDBMSAdaptertypeInfo - the typeInfo object for which the precision value is needed.
public boolean isValidPrimaryKeyType(int datatype)
isValidPrimaryKeyType in interface RDBMSAdapterdatatype - The JDBC type.
public java.lang.String getSurrogateForEmptyStrings()
getSurrogateForEmptyStrings in interface RDBMSAdapterpublic int getTransactionIsolationForSchemaCreation()
getTransactionIsolationForSchemaCreation in interface RDBMSAdapterpublic int getRequiredTransactionIsolationLevel()
getRequiredTransactionIsolationLevel in interface RDBMSAdapter
public java.lang.String getCatalogName(java.sql.Connection conn)
throws java.sql.SQLException
getCatalogName in interface RDBMSAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the catalog name.
public java.lang.String getSchemaName(java.sql.Connection conn)
throws java.sql.SQLException
getSchemaName in interface RDBMSAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the schema name.public java.lang.String getCatalogSeparator()
getCatalogSeparator in interface org.datanucleus.store.mapped.DatastoreAdapterpublic java.lang.String getSelectWithLockOption()
getSelectWithLockOption in interface RDBMSAdapterpublic java.lang.String getSelectForUpdateText()
public java.lang.String getSelectNewUUIDStmt()
getSelectNewUUIDStmt in interface RDBMSAdapterpublic java.lang.String getNewUUIDFunction()
public java.lang.String getOrderString(org.datanucleus.store.StoreManager storeMgr,
java.lang.String orderString,
SQLExpression sqlExpr)
getOrderString in interface RDBMSAdapterstoreMgr - StoreManagerorderString - The basic ordering stringsqlExpr - The sql expression being represented here
public boolean validToSelectMappingInStatement(SQLStatement stmt,
org.datanucleus.store.mapped.mapping.JavaTypeMapping m)
validToSelectMappingInStatement in interface RDBMSAdapterstmt - The statementm - The mapping that we want to select
public java.lang.String getAutoIncrementStmt(Table table,
java.lang.String columnName)
getAutoIncrementStmt in interface RDBMSAdaptertable - Name of the table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public java.lang.String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdapterpublic boolean isIdentityFieldDataType(java.lang.String typeName)
typeName is auto incremented by the datastore.
isIdentityFieldDataType in interface org.datanucleus.store.mapped.DatastoreAdaptertypeName - the datastore type name
typeName has values auto incremented by the datastorepublic java.lang.String getInsertStatementForNoColumns(Table table)
getInsertStatementForNoColumns in interface RDBMSAdaptertable - The table
public java.lang.String getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Integer start,
java.lang.Integer increment,
java.lang.Integer cache_size)
getSequenceCreateStmt in interface RDBMSAdaptersequence_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 sequence
public java.lang.String getSequenceNextStmt(java.lang.String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptersequence_name - Name of the sequence
public java.sql.ResultSet getExistingIndexes(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
getExistingIndexes in interface RDBMSAdapterconn - the JDBC connectioncatalog - the catalog nameschema - the schema nametable - the table name
java.sql.SQLException
public java.lang.String getCreateTableStatement(TableImpl table,
Column[] columns,
java.util.Properties props,
org.datanucleus.store.mapped.IdentifierFactory factory)
CREATE TABLE FOO ( BAR VARCHAR(30), BAZ INTEGER )
getCreateTableStatement in interface RDBMSAdaptertable - The table to create.columns - The columns of the table.props - Properties for controlling the table creationfactory - Factory for identifiers
public java.lang.String getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR) ALTER TABLE FOO ADD PRIMARY KEY (BAR)
getAddPrimaryKeyStatement in interface RDBMSAdapterpk - An object describing the primary key.factory - Identifier factory
public java.lang.String getAddCandidateKeyStatement(CandidateKey ck,
org.datanucleus.store.mapped.IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ) ALTER TABLE FOO ADD UNIQUE (BAZ)
getAddCandidateKeyStatement in interface RDBMSAdapterck - An object describing the candidate key.factory - Identifier factory
public java.lang.String getAddForeignKeyStatement(ForeignKey fk,
org.datanucleus.store.mapped.IdentifierFactory factory)
ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2) ALTER TABLE FOO ADD FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
getAddForeignKeyStatement in interface RDBMSAdapterfk - An object describing the foreign key.factory - Identifier factory
public java.lang.String getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptertable - The tablecol - The column
public java.lang.String getCreateIndexStatement(Index idx,
org.datanucleus.store.mapped.IdentifierFactory factory)
CREATE INDEX FOO_N1 ON FOO (BAR,BAZ) [Extended Settings] CREATE UNIQUE INDEX FOO_U1 ON FOO (BAR,BAZ) [Extended Settings]
getCreateIndexStatement in interface RDBMSAdapteridx - An object describing the index.factory - Identifier factory
public java.lang.String getCheckConstraintForValues(org.datanucleus.store.mapped.DatastoreIdentifier identifier,
java.lang.Object[] values,
boolean nullable)
CHECK ("COLUMN" IN ('VAL1','VAL2') OR "COLUMN" IS NULL)
getCheckConstraintForValues in interface RDBMSAdapteridentifier - Column identifiervalues - Valid valuesnullable - whether the datastore identifier is null
public java.lang.String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
DROP TABLE FOO CASCADE
getDropTableStatement in interface RDBMSAdaptertable - The table to drop.
public java.lang.String getDropViewStatement(ViewImpl view)
DROP VIEW FOO
getDropViewStatement in interface RDBMSAdapterview - The view to drop.
public java.lang.String getDeleteTableStatement(SQLTable tbl)
DELETE FROM tbl t1. Doesn't include any where clause.
getDeleteTableStatement in interface RDBMSAdaptertbl - The SQLTable to delete
public java.lang.String getRangeByLimitEndOfStatementClause(long offset,
long count)
getRangeByLimitEndOfStatementClause in interface RDBMSAdapteroffset - The offset to return fromcount - The number of items to return
public java.lang.String getRangeByRowNumberColumn()
getRangeByRowNumberColumn in interface RDBMSAdapterpublic java.lang.String getRangeByRowNumberColumn2()
getRangeByRowNumberColumn2 in interface RDBMSAdapter
public java.sql.ResultSet getColumns(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String columnNamePattern)
throws java.sql.SQLException
getColumns in interface RDBMSAdapterconn - 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)
java.sql.SQLException - Thrown if an error occurspublic java.lang.String toString()
toString in interface org.datanucleus.store.mapped.DatastoreAdaptertoString in class java.lang.Objectpublic java.lang.String getDatastoreDateStatement()
getDatastoreDateStatement in interface RDBMSAdapterpublic java.lang.String getPatternExpressionAnyCharacter()
public java.lang.String getPatternExpressionZeroMoreCharacters()
public java.lang.String getEscapePatternExpression()
public java.lang.String getEscapeCharacter()
public java.lang.String getContinuationString()
public java.lang.String getNumericConversionFunction()
public java.lang.String getOperatorConcat()
public boolean isStatementCancel(java.sql.SQLException sqle)
isStatementCancel in interface RDBMSAdaptersqle - the exception
public boolean isStatementTimeout(java.sql.SQLException sqle)
isStatementTimeout in interface RDBMSAdaptersqle - the exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||