|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.mapped.AbstractDatastoreAdapter
org.jpox.store.rdbms.adapter.DatabaseAdapter
org.jpox.store.rdbms.adapter.H2Adapter
public class H2Adapter
Provides methods for adapting SQL language elements to the H2 Database Engine.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter |
|---|
DatabaseAdapter.JDBCTypeInfo |
| Field Summary |
|---|
| Fields inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, identifierQuoteString, LOCALISER_BASE, mappingManager, reservedKeywords |
| Constructor Summary | |
|---|---|
H2Adapter(java.sql.DatabaseMetaData metadata)
Constructs a H2 adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
java.lang.String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.jpox.store.mapped.IdentifierFactory factory)
HSQL 1.7.0 does not support ALTER TABLE to define a primary key |
java.lang.String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
java.lang.String |
getAutoIncrementStmt(Table table,
java.lang.String columnName)
Accessor for the auto-increment sql statement for this datastore. |
java.lang.String |
getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
java.lang.String |
getInsertStatementForNoColumns(Table table)
Method to retutn the INSERT statement to use when inserting into a table that has no columns specified. |
int |
getMaxColumnNameLength()
Accessor for the maximum column name length permitted on this datastore. |
int |
getMaxConstraintNameLength()
Accessor for the maximum constraint name length permitted on this datastore. |
int |
getMaxIndexNameLength()
Accessor for the maximum index name length permitted on this datastore. |
int |
getMaxTableNameLength()
Accessor for the maximum table name length permitted on this datastore. |
java.lang.String |
getRangeByLimitSelectClause(long offset,
long count)
Method to return the SQL to append to the SELECT clause of a SELECT statement to handle restriction of ranges using the LIMUT keyword. |
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 |
getVendorID()
Accessor for the vendor ID for this adapter. |
boolean |
isValidPrimaryKeyType(int datatype)
Accessor for whether the specified type is allow to be part of a PK. |
org.jpox.store.mapped.expression.NumericExpression |
modOperator(org.jpox.store.mapped.expression.ScalarExpression operand1,
org.jpox.store.mapped.expression.ScalarExpression operand2)
Method to generate a modulus expression. |
org.jpox.store.mapped.expression.LogicSetExpression |
newTableExpression(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar)
Return a new TableExpression appropriate to MySQL. |
TypeInfo |
newTypeInfo(java.sql.ResultSet rs)
Factory for TypeInfo objects. |
boolean |
supportsAnalysisMethods()
Accessor for whether the SQL extensions CUBE, ROLLUP are supported. |
boolean |
supportsCheckConstraintsInEndCreateStatements()
Whether this datastore supports the use of CHECK after the column definitions in CREATE TABLE statements (DDL). |
boolean |
supportsDeferredConstraints()
Whether we support deferred constraints in keys. |
boolean |
supportsIdentityFields()
Whether we support autoincrementing fields. |
boolean |
supportsLockWithSelectForUpdate()
Whether this datastore supports locking using SELECT ... |
boolean |
supportsPrimaryKeyInCreateStatements()
Whether the datastore supports specification of the primary key in CREATE TABLE statements. |
boolean |
supportsTransactionIsolationLevel(int isolationLevel)
Accessor for whether the adapter supports the transaction isolation level. |
boolean |
supportsUniqueConstraintsInEndCreateStatements()
Whether to allow Unique statements in the section of CREATE TABLE after the column definitions. |
| Methods inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMapping, getMapping, getMapping, getMapping, getMapping, getMappingManager, getMiliseconds, getTime, isBitReallyBoolean, isReservedKeyword, supportsQueryFetchSize, supportsSequences |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jpox.store.rdbms.adapter.RDBMSAdapter |
|---|
getIdentifierQuoteString, supportsSequences |
| Methods inherited from interface org.jpox.store.mapped.DatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getMapping, getMapping, getMapping, getMapping, getMappingManager, isBitReallyBoolean, isReservedKeyword, supportsQueryFetchSize |
| Constructor Detail |
|---|
public H2Adapter(java.sql.DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public java.lang.String getVendorID()
getVendorID in interface org.jpox.store.mapped.DatastoreAdaptergetVendorID in class org.jpox.store.mapped.AbstractDatastoreAdapterpublic TypeInfo newTypeInfo(java.sql.ResultSet rs)
newTypeInfo in class DatabaseAdapterrs - The ResultSet from DatabaseMetaData.getTypeInfo().
public int getMaxTableNameLength()
getMaxTableNameLength in interface RDBMSAdaptergetMaxTableNameLength in class DatabaseAdapterpublic int getMaxConstraintNameLength()
getMaxConstraintNameLength in interface RDBMSAdaptergetMaxConstraintNameLength in class DatabaseAdapterpublic int getMaxIndexNameLength()
getMaxIndexNameLength in interface RDBMSAdaptergetMaxIndexNameLength in class DatabaseAdapterpublic int getMaxColumnNameLength()
getMaxColumnNameLength in interface RDBMSAdaptergetMaxColumnNameLength in class DatabaseAdapter
public java.lang.String getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public java.lang.String getRangeByLimitSelectClause(long offset,
long count)
getRangeByLimitSelectClause in interface RDBMSAdaptergetRangeByLimitSelectClause in class DatabaseAdapteroffset - The offset to return fromcount - The number of items to return
public boolean supportsTransactionIsolationLevel(int isolationLevel)
supportsTransactionIsolationLevel in interface RDBMSAdaptersupportsTransactionIsolationLevel in class DatabaseAdapterisolationLevel - the isolation level
public int getRequiredTransactionIsolationLevel()
getRequiredTransactionIsolationLevel in interface RDBMSAdaptergetRequiredTransactionIsolationLevel in class DatabaseAdapterpublic boolean supportsPrimaryKeyInCreateStatements()
supportsPrimaryKeyInCreateStatements in interface RDBMSAdaptersupportsPrimaryKeyInCreateStatements in class DatabaseAdapterpublic boolean supportsLockWithSelectForUpdate()
supportsLockWithSelectForUpdate in interface RDBMSAdaptersupportsLockWithSelectForUpdate in class DatabaseAdapter
public java.lang.String getSchemaName(java.sql.Connection conn)
throws java.sql.SQLException
getSchemaName in interface RDBMSAdaptergetSchemaName in class DatabaseAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the
schema name.
public java.lang.String getAddPrimaryKeyStatement(PrimaryKey pk,
org.jpox.store.mapped.IdentifierFactory factory)
getAddPrimaryKeyStatement in interface RDBMSAdaptergetAddPrimaryKeyStatement in class DatabaseAdapterpk - An object describing the primary key.factory - Identifier factory
public java.lang.String getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
DROP TABLE FOO
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public boolean supportsDeferredConstraints()
supportsDeferredConstraints in interface RDBMSAdaptersupportsDeferredConstraints in class DatabaseAdapterpublic boolean supportsIdentityFields()
supportsIdentityFields in interface org.jpox.store.mapped.DatastoreAdaptersupportsIdentityFields in class org.jpox.store.mapped.AbstractDatastoreAdapterpublic boolean supportsAnalysisMethods()
supportsAnalysisMethods in interface RDBMSAdaptersupportsAnalysisMethods in class DatabaseAdapter
public java.lang.String getAutoIncrementStmt(Table table,
java.lang.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 java.lang.String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic java.lang.String getInsertStatementForNoColumns(Table table)
getInsertStatementForNoColumns in interface RDBMSAdaptergetInsertStatementForNoColumns in class DatabaseAdaptertable - The table
public boolean supportsUniqueConstraintsInEndCreateStatements()
supportsUniqueConstraintsInEndCreateStatements in interface RDBMSAdaptersupportsUniqueConstraintsInEndCreateStatements in class DatabaseAdapterDatabaseAdapter.supportsUniqueConstraintsInEndCreateStatements()public boolean supportsCheckConstraintsInEndCreateStatements()
supportsCheckConstraintsInEndCreateStatements in class DatabaseAdapterpublic boolean isValidPrimaryKeyType(int datatype)
isValidPrimaryKeyType in interface RDBMSAdapterisValidPrimaryKeyType in class DatabaseAdapterdatatype - The JDBC type
public org.jpox.store.mapped.expression.NumericExpression modOperator(org.jpox.store.mapped.expression.ScalarExpression operand1,
org.jpox.store.mapped.expression.ScalarExpression operand2)
modOperator in interface org.jpox.store.mapped.DatastoreAdaptermodOperator in interface org.jpox.store.mapped.expression.ExpressionOperatorAdaptermodOperator in class org.jpox.store.mapped.AbstractDatastoreAdapteroperand1 - the left expressionoperand2 - the right expression
public org.jpox.store.mapped.expression.LogicSetExpression newTableExpression(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar)
newTableExpression in interface RDBMSAdapternewTableExpression in class DatabaseAdapterqs - The QueryStatement to add the expression totable - The table in the expressionrangeVar - range variable to assign to the expression.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||