|
||||||||||
| 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.HSQLAdapter
public class HSQLAdapter
Provides methods for adapting SQL language elements to the Hypersonic SQL Server database.
| 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 | |
|---|---|
HSQLAdapter(java.sql.DatabaseMetaData metadata)
Constructs a Hypersonic SQL 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 |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date. |
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 |
getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String cache_size)
Accessor for the sequence statement to create the sequence. |
java.lang.String |
getSequenceNextStmt(java.lang.String sequence_name)
Accessor for the statement for getting the next id from the sequence 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 |
supportsCheckInCreateStatements()
Whether this datastore supports the use of CHECK in CREATE TABLE statements (DDL). |
boolean |
supportsDeferredConstraints()
Whether we support deferred constraints in keys. |
boolean |
supportsForeignKeyDeleteAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key delete action |
boolean |
supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key update action |
boolean |
supportsIdentityFields()
Whether we support autoincrementing fields. |
boolean |
supportsPrimaryKeyInCreateStatements()
Whether the datastore supports specification of the primary key in CREATE TABLE statements. |
boolean |
supportsSequences()
Whether we support sequences. |
boolean |
supportsStatementBatching()
Whether this datastore supports batching of statements. |
boolean |
supportsStatementGetGeneratedKeys()
Whether the datastore supports Statement.getGeneratedKeys() |
boolean |
supportsTransactionIsolationLevel(int isolationLevel)
Accessor for whether the adapter supports the transaction isolation level HSQL 1.7.0 does not support Connection.setTransactionIsolation(isolationLevel); Up to and including 1.7.1, HSQLDB supports only TRANSACTION_READ_UNCOMMITTED. |
boolean |
supportsUniqueConstraintsInEndCreateStatements()
Whether to allow Unique statements in the section of CREATE TABLE after the column definitions. |
org.jpox.store.mapped.expression.StringExpression |
trimMethod(org.jpox.store.mapped.expression.StringExpression str,
boolean leading,
boolean trailing)
Returns the appropriate SQL expression for the java query "trim" method. |
| Methods inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMapping, getMapping, getMapping, getMapping, getMapping, getMappingManager, getMiliseconds, getTime, isBitReallyBoolean, isReservedKeyword, supportsQueryFetchSize |
| 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 |
| Methods inherited from interface org.jpox.store.mapped.DatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getMapping, getMapping, getMapping, getMapping, getMappingManager, isBitReallyBoolean, isReservedKeyword, supportsQueryFetchSize |
| Constructor Detail |
|---|
public HSQLAdapter(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 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 TypeInfo newTypeInfo(java.sql.ResultSet rs)
newTypeInfo in class DatabaseAdapterrs - The ResultSet from DatabaseMetaData.getTypeInfo().
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 supportsStatementGetGeneratedKeys()
Statement.getGeneratedKeys()
supportsStatementGetGeneratedKeys in interface RDBMSAdaptersupportsStatementGetGeneratedKeys in class DatabaseAdapterpublic boolean supportsStatementBatching()
supportsStatementBatching in interface RDBMSAdaptersupportsStatementBatching in class DatabaseAdapterpublic boolean supportsAnalysisMethods()
supportsAnalysisMethods in interface RDBMSAdaptersupportsAnalysisMethods 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 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.
public boolean supportsDeferredConstraints()
supportsDeferredConstraints in interface RDBMSAdaptersupportsDeferredConstraints in class DatabaseAdapterpublic boolean supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
supportsForeignKeyUpdateAction in interface RDBMSAdaptersupportsForeignKeyUpdateAction in class DatabaseAdapteraction - The update action
public boolean supportsForeignKeyDeleteAction(ForeignKey.FKAction action)
supportsForeignKeyDeleteAction in interface RDBMSAdaptersupportsForeignKeyDeleteAction in class DatabaseAdapteraction - The delete action
public boolean supportsIdentityFields()
supportsIdentityFields in interface org.jpox.store.mapped.DatastoreAdaptersupportsIdentityFields in class org.jpox.store.mapped.AbstractDatastoreAdapter
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 supportsCheckInCreateStatements()
supportsCheckInCreateStatements in interface RDBMSAdaptersupportsCheckInCreateStatements in class DatabaseAdapterpublic 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.StringExpression trimMethod(org.jpox.store.mapped.expression.StringExpression str,
boolean leading,
boolean trailing)
LTRIM(RTRIM(str))
trimMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptertrimMethod in class DatabaseAdapterstr - The first argument to the trim() method.leading - Whether to trim leading spacestrailing - Whether to trim trailing spaces
public java.lang.String getDatastoreDateStatement()
getDatastoreDateStatement in interface RDBMSAdaptergetDatastoreDateStatement in class DatabaseAdapterpublic boolean supportsSequences()
supportsSequences in interface org.jpox.store.mapped.DatastoreAdaptersupportsSequences in interface RDBMSAdaptersupportsSequences in class org.jpox.store.mapped.AbstractDatastoreAdapter
public java.lang.String getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String 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 java.lang.String getSequenceNextStmt(java.lang.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 | |||||||||