|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
org.datanucleus.store.rdbms.adapter.DerbyAdapter
public class DerbyAdapter
Provides methods for adapting SQL language elements to the Cloudscape/Derby database.
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter |
|---|
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions |
| 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 | |
|---|---|
DerbyAdapter(DatabaseMetaData metadata)
Constructs an Apache Derby adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
String |
getAddCandidateKeyStatement(CandidateKey ck,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a candidate key to its table. |
String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
String |
getAutoIncrementStmt(Table table,
String columnName)
Accessor for the auto-increment SQL statement for this datastore. |
String |
getCatalogName(Connection conn)
Accessor for the catalog name. |
String |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date. |
String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
String |
getInsertStatementForNoColumns(Table table)
Method to return the INSERT statement to use when inserting into a table that has no columns specified. |
String |
getNumericConversionFunction()
Accessor for the function to use for converting to numeric. |
String |
getSchemaName(Connection conn)
Accessor for the schema name. |
String |
getSelectForUpdateText()
Method returning the text to append to the end of the SELECT to perform the equivalent of "SELECT ... |
String |
getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
Accessor for the sequence statement to create the sequence. |
String |
getSequenceNextStmt(String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore. |
String |
getVendorID()
Accessor for the vendor id. |
void |
initialiseDatastore(Object conn)
Creates the auxiliary functions/procedures in the schema |
boolean |
isIdentityFieldDataType(String columnDef)
Verifies if the given columnDef is auto incremented by the datastore. |
boolean |
isStatementCancel(SQLException sqle)
return whether this exception represents a cancelled statement. |
SQLTypeInfo |
newSQLTypeInfo(ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
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 |
| Constructor Detail |
|---|
public DerbyAdapter(DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public void initialiseDatastore(Object conn)
initialiseDatastore in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseDatastore in class DatabaseAdapterconn - the connection to the datastore
public String getSchemaName(Connection conn)
throws SQLException
getSchemaName in interface RDBMSAdaptergetSchemaName in class DatabaseAdapterconn - The Connection to use
SQLException
public String getCatalogName(Connection conn)
throws SQLException
getCatalogName in interface RDBMSAdaptergetCatalogName in class DatabaseAdapterconn - The Connection to use
SQLExceptionpublic String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapterpublic SQLTypeInfo newSQLTypeInfo(ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
DatabaseAdapter
DROP TABLE FOO CASCADE
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public String getAddCandidateKeyStatement(CandidateKey ck,
org.datanucleus.store.mapped.IdentifierFactory factory)
CREATE [UNIQUE] INDEX FOO_CK ON TBL (COL1 [, COL2])
getAddCandidateKeyStatement in interface RDBMSAdaptergetAddCandidateKeyStatement in class DatabaseAdapterck - An object describing the candidate key.factory - Identifier factory
public String getAutoIncrementStmt(Table table,
String columnName)
getAutoIncrementStmt in interface RDBMSAdaptergetAutoIncrementStmt in class DatabaseAdaptertable - Name of the table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic boolean isIdentityFieldDataType(String columnDef)
columnDef is auto incremented by the datastore.
isIdentityFieldDataType in interface org.datanucleus.store.mapped.DatastoreAdapterisIdentityFieldDataType in class DatabaseAdaptercolumnDef - the datastore type name
columnDef has values auto incremented by the datastorepublic String getInsertStatementForNoColumns(Table table)
getInsertStatementForNoColumns in interface RDBMSAdaptergetInsertStatementForNoColumns in class DatabaseAdaptertable - The table
public String getDatastoreDateStatement()
getDatastoreDateStatement in interface RDBMSAdaptergetDatastoreDateStatement in class DatabaseAdapterpublic String getSelectForUpdateText()
getSelectForUpdateText in class DatabaseAdapter
public boolean validToSelectMappingInStatement(SQLStatement stmt,
org.datanucleus.store.mapped.mapping.JavaTypeMapping m)
validToSelectMappingInStatement in interface RDBMSAdaptervalidToSelectMappingInStatement in class DatabaseAdapterstmt - The statementm - The mapping that we want to select
public String getNumericConversionFunction()
getNumericConversionFunction in class DatabaseAdapterpublic boolean isStatementCancel(SQLException sqle)
isStatementCancel in interface RDBMSAdapterisStatementCancel in class DatabaseAdaptersqle - the exception
public String getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
getSequenceCreateStmt in interface RDBMSAdaptergetSequenceCreateStmt in class DatabaseAdaptersequence_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 String getSequenceNextStmt(String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptergetSequenceNextStmt in class DatabaseAdaptersequence_name - Name of the sequence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||