org.jpox.store.rdbms.adapter
Class HSQLAdapter

java.lang.Object
  extended by org.jpox.store.mapped.AbstractDatastoreAdapter
      extended by org.jpox.store.rdbms.adapter.DatabaseAdapter
          extended by org.jpox.store.rdbms.adapter.HSQLAdapter
All Implemented Interfaces:
org.jpox.store.mapped.DatastoreAdapter, org.jpox.store.mapped.expression.ExpressionConversionAdapter, org.jpox.store.mapped.expression.ExpressionLogicSetAdapter, org.jpox.store.mapped.expression.ExpressionMethodAdapter, org.jpox.store.mapped.expression.ExpressionOperatorAdapter, org.jpox.store.mapped.expression.ExpressionPatternAdapter, org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdapter, RDBMSAdapter

public class HSQLAdapter
extends DatabaseAdapter

Provides methods for adapting SQL language elements to the Hypersonic SQL Server database.

Version:
$Revision: 1.50 $

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.rdbms.adapter.DatabaseAdapter
catalogSeparator, driverMajorVersion, driverMinorVersion, driverName, driverVersion, LOCALISER, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesLowerCaseQuotedIdentifiers, storesMixedCaseIdentifiers, storesMixedCaseQuotedIdentifiers, storesMixedCaseQuotedSensitiveIdentifiers, storesMixedCaseSensitiveIdentifiers, storesUpperCaseIdentifiers, storesUpperCaseQuotedIdentifiers, supportsCatalogsInTableDefinitions, supportsSchemasInTableDefinitions, supportsStatementBatching, typesByTypeNumber
 
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.rdbms.adapter.DatabaseAdapter
absMethod, acosMethod, addTypeInfo, asinMethod, atanMethod, cartersianProduct, ceilMethod, closeConnection, concatOperator, cosMethod, createIndexesBeforeForeignKeys, endsWithMethod, expMethod, floorMethod, getAddCandidateKeyStatement, getAddForeignKeyStatement, getCatalogName, getCatalogSeparator, getCharColumnsPaddedWithSpaces, getCheckConstraintForValues, getColumns, getColumns, getConnection, getContinuationString, getCreateIndexStatement, getCreateTableStatement, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDayMethod, getDriverMajorVersion, getDriverMinorVersion, getDropViewStatement, getEscapeCharacter, getEscapedPatternExpression, getEscapePatternExpression, getExistingIndexes, getHourMethod, getMaxForeignKeys, getMaxIndexes, getMinuteMethod, getMonthMethod, getNewMappingManager, getNewUUIDFunction, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getNonAnsiRightOuterJoinWhereClause, getOperatorConcat, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters, getPlaceWithOptionAfterFromClause, getPlaceWithOptionWithinJoinClauses, getRangeByLimitWhereClause, getRangeByRowNumberColumn, getSecondMethod, getSelectNewUUIDStmt, getSelectWithLockOption, getSupportsPersistOfUnassignedChar, getSurrogateForEmptyStrings, getTables, getTransactionIsolationForSchemaCreation, getTypeInfo, getUnlimitedLengthPrecisionValue, getYearMethod, includeOrderByColumnsInSelect, indexOfMethod, initialiseDatastore, isIdentityFieldDataType, isNullEqualsEmptyStrings, isSQLKeyword, isStoresLowerCaseIdentifiers, isStoresLowerCaseQuotedIdentifiers, isStoresMixedCaseIdentifiers, isStoresMixedCaseQuotedIdentifiers, isStoresUpperCaseIdentifiers, isStoresUpperCaseQuotedIdentifiers, iteratorReservedWords, iteratorTypeInfo, lengthMethod, loadDatastoreMapping, logConfiguration, logMethod, matchesMethod, newColumnInfo, newExportedKeyInfo, newForeignKeyInfo, newQueryStatement, newQueryStatement, parseKeywordList, requiresColumnDefaultsInitialising, setDefaultTypeInfoForJDBCType, sinMethod, sqrtMethod, startsWithMethod, substringMethod, substringMethod, supportsAlterTableDropConstraint, supportsAlterTableDropForeignKeyConstraint, supportsAnsiJoinSyntax, supportsAutoIncrementColumnTypeSpecification, supportsAutoIncrementKeysNullSpecification, supportsBooleanComparison, supportsCatalogsInTableDefinitions, supportsDefaultBeforeNullInColumnOptions, supportsDefaultKeywordInColumnOptions, supportsDefaultKeywordWithNotNullInColumnOptions, supportsDistinctWithSelectForUpdate, supportsEscapeExpressionInLikePredicate, supportsExistsSyntax, supportsLockWithSelectForUpdate, supportsNullsInCandidateKeys, supportsNullsKeywordInColumnOptions, supportsProjectionInTableReferenceJoins, supportsSchemasInTableDefinitions, supportsSettingBlobUsingSetString, supportsSettingClobUsingSetString, supportsUnionSyntax, tanMethod, toNumericExpression, toString, toStringExpression, toStringExpression, translateMethod, useUnionAll
 
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

HSQLAdapter

public HSQLAdapter(java.sql.DatabaseMetaData metadata)
Constructs a Hypersonic SQL adapter based on the given JDBC metadata.

Parameters:
metadata - the database metadata.
Method Detail

getVendorID

public java.lang.String getVendorID()
Accessor for the vendor ID for this adapter.

Specified by:
getVendorID in interface org.jpox.store.mapped.DatastoreAdapter
Overrides:
getVendorID in class org.jpox.store.mapped.AbstractDatastoreAdapter
Returns:
The vendor ID

getMaxTableNameLength

public int getMaxTableNameLength()
Accessor for the maximum table name length permitted on this datastore.

Specified by:
getMaxTableNameLength in interface RDBMSAdapter
Overrides:
getMaxTableNameLength in class DatabaseAdapter
Returns:
Max table name length

getMaxConstraintNameLength

public int getMaxConstraintNameLength()
Accessor for the maximum constraint name length permitted on this datastore.

Specified by:
getMaxConstraintNameLength in interface RDBMSAdapter
Overrides:
getMaxConstraintNameLength in class DatabaseAdapter
Returns:
Max constraint name length

getMaxIndexNameLength

public int getMaxIndexNameLength()
Accessor for the maximum index name length permitted on this datastore.

Specified by:
getMaxIndexNameLength in interface RDBMSAdapter
Overrides:
getMaxIndexNameLength in class DatabaseAdapter
Returns:
Max index name length

getMaxColumnNameLength

public int getMaxColumnNameLength()
Accessor for the maximum column name length permitted on this datastore.

Specified by:
getMaxColumnNameLength in interface RDBMSAdapter
Overrides:
getMaxColumnNameLength in class DatabaseAdapter
Returns:
Max column name length

getAddColumnStatement

public java.lang.String getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
                                              Column col)
Accessor for the SQL statement to add a column to a table.

Specified by:
getAddColumnStatement in interface RDBMSAdapter
Overrides:
getAddColumnStatement in class DatabaseAdapter
Parameters:
table - The table
col - The column
Returns:
The SQL necessary to add the column

getRangeByLimitSelectClause

public 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.

Specified by:
getRangeByLimitSelectClause in interface RDBMSAdapter
Overrides:
getRangeByLimitSelectClause in class DatabaseAdapter
Parameters:
offset - The offset to return from
count - The number of items to return
Returns:
The SQL to append to allow for ranges using LIMIT.

newTypeInfo

public TypeInfo newTypeInfo(java.sql.ResultSet rs)
Factory for TypeInfo objects.

Overrides:
newTypeInfo in class DatabaseAdapter
Parameters:
rs - The ResultSet from DatabaseMetaData.getTypeInfo().
Returns:
A TypeInfo object.

supportsTransactionIsolationLevel

public 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.

Specified by:
supportsTransactionIsolationLevel in interface RDBMSAdapter
Overrides:
supportsTransactionIsolationLevel in class DatabaseAdapter
Parameters:
isolationLevel - the isolation level
Returns:
Whether the transaction isolation level setting is supported.

getRequiredTransactionIsolationLevel

public int getRequiredTransactionIsolationLevel()
Accessor for the "required" transaction isolation level if it has to be a certain value for this adapter.

Specified by:
getRequiredTransactionIsolationLevel in interface RDBMSAdapter
Overrides:
getRequiredTransactionIsolationLevel in class DatabaseAdapter
Returns:
Transaction isolation level (-1 implies no restriction)

supportsPrimaryKeyInCreateStatements

public boolean supportsPrimaryKeyInCreateStatements()
Whether the datastore supports specification of the primary key in CREATE TABLE statements.

Specified by:
supportsPrimaryKeyInCreateStatements in interface RDBMSAdapter
Overrides:
supportsPrimaryKeyInCreateStatements in class DatabaseAdapter
Returns:
Whetehr it allows "PRIMARY KEY ..."

supportsStatementGetGeneratedKeys

public boolean supportsStatementGetGeneratedKeys()
Whether the datastore supports Statement.getGeneratedKeys()

Specified by:
supportsStatementGetGeneratedKeys in interface RDBMSAdapter
Overrides:
supportsStatementGetGeneratedKeys in class DatabaseAdapter
Returns:
true if it is supported

supportsStatementBatching

public boolean supportsStatementBatching()
Whether this datastore supports batching of statements.

Specified by:
supportsStatementBatching in interface RDBMSAdapter
Overrides:
supportsStatementBatching in class DatabaseAdapter
Returns:
whether we can use statement batching

supportsAnalysisMethods

public boolean supportsAnalysisMethods()
Accessor for whether the SQL extensions CUBE, ROLLUP are supported.

Specified by:
supportsAnalysisMethods in interface RDBMSAdapter
Overrides:
supportsAnalysisMethods in class DatabaseAdapter
Returns:
Whether the SQL extensions CUBE, ROLLUP are supported.

getSchemaName

public java.lang.String getSchemaName(java.sql.Connection conn)
                               throws java.sql.SQLException
Accessor for the Schema Name for this datastore. HSQL 1.7.0 does not support schemas (catalog)

Specified by:
getSchemaName in interface RDBMSAdapter
Overrides:
getSchemaName in class DatabaseAdapter
Parameters:
conn - Connection to the datastore
Returns:
The schema name
Throws:
java.sql.SQLException - Thrown if error occurs in determining the schema name.

getAddPrimaryKeyStatement

public 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

Specified by:
getAddPrimaryKeyStatement in interface RDBMSAdapter
Overrides:
getAddPrimaryKeyStatement in class DatabaseAdapter
Parameters:
pk - An object describing the primary key.
factory - Identifier factory
Returns:
The PK statement

getDropTableStatement

public java.lang.String getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. It should return something like:
 DROP TABLE FOO
 

Specified by:
getDropTableStatement in interface RDBMSAdapter
Overrides:
getDropTableStatement in class DatabaseAdapter
Parameters:
table - The table to drop.
Returns:
The text of the SQL statement.

newTableExpression

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)
Return a new TableExpression appropriate to MySQL. MySQL does not support the TableExprAsSubjoins so instead we use TableExprAsJoins.

Specified by:
newTableExpression in interface RDBMSAdapter
Overrides:
newTableExpression in class DatabaseAdapter
Parameters:
qs - The QueryStatement to add the expression to
table - The table in the expression
rangeVar - range variable to assign to the expression.
Returns:
The expression.

supportsDeferredConstraints

public boolean supportsDeferredConstraints()
Whether we support deferred constraints in keys.

Specified by:
supportsDeferredConstraints in interface RDBMSAdapter
Overrides:
supportsDeferredConstraints in class DatabaseAdapter
Returns:
whether we support deferred constraints in keys.

supportsForeignKeyUpdateAction

public boolean supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key update action

Specified by:
supportsForeignKeyUpdateAction in interface RDBMSAdapter
Overrides:
supportsForeignKeyUpdateAction in class DatabaseAdapter
Parameters:
action - The update action
Returns:
Whether it is supported

supportsForeignKeyDeleteAction

public boolean supportsForeignKeyDeleteAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key delete action

Specified by:
supportsForeignKeyDeleteAction in interface RDBMSAdapter
Overrides:
supportsForeignKeyDeleteAction in class DatabaseAdapter
Parameters:
action - The delete action
Returns:
Whether it is supported

supportsIdentityFields

public boolean supportsIdentityFields()
Whether we support autoincrementing fields.

Specified by:
supportsIdentityFields in interface org.jpox.store.mapped.DatastoreAdapter
Overrides:
supportsIdentityFields in class org.jpox.store.mapped.AbstractDatastoreAdapter
Returns:
whether we support autoincrementing fields.

getAutoIncrementStmt

public java.lang.String getAutoIncrementStmt(Table table,
                                             java.lang.String columnName)
Accessor for the auto-increment sql statement for this datastore.

Specified by:
getAutoIncrementStmt in interface RDBMSAdapter
Overrides:
getAutoIncrementStmt in class DatabaseAdapter
Parameters:
table - Name of the table that the autoincrement is for
columnName - Name of the column that the autoincrement is for
Returns:
The statement for getting the latest auto-increment key

getAutoIncrementKeyword

public java.lang.String getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...).

Specified by:
getAutoIncrementKeyword in interface RDBMSAdapter
Overrides:
getAutoIncrementKeyword in class DatabaseAdapter
Returns:
The keyword for a column using auto-increment

getInsertStatementForNoColumns

public java.lang.String getInsertStatementForNoColumns(Table table)
Method to retutn the INSERT statement to use when inserting into a table that has no columns specified. This is the case when we have a single column in the table and that column is autoincrement/identity (and so is assigned automatically in the datastore).

Specified by:
getInsertStatementForNoColumns in interface RDBMSAdapter
Overrides:
getInsertStatementForNoColumns in class DatabaseAdapter
Parameters:
table - The table
Returns:
The INSERT statement

supportsUniqueConstraintsInEndCreateStatements

public boolean supportsUniqueConstraintsInEndCreateStatements()
Whether to allow Unique statements in the section of CREATE TABLE after the column definitions.

Specified by:
supportsUniqueConstraintsInEndCreateStatements in interface RDBMSAdapter
Overrides:
supportsUniqueConstraintsInEndCreateStatements in class DatabaseAdapter
Returns:
whether we can use UNIQUE after the column definitions CREATE TABLE.
See Also:
DatabaseAdapter.supportsUniqueConstraintsInEndCreateStatements()

supportsCheckInCreateStatements

public boolean supportsCheckInCreateStatements()
Whether this datastore supports the use of CHECK in CREATE TABLE statements (DDL). HSQL doesn't seem to support this.

Specified by:
supportsCheckInCreateStatements in interface RDBMSAdapter
Overrides:
supportsCheckInCreateStatements in class DatabaseAdapter
Returns:
whether we can use CHECK in CREATE TABLE.

supportsCheckConstraintsInEndCreateStatements

public boolean supportsCheckConstraintsInEndCreateStatements()
Whether this datastore supports the use of CHECK after the column definitions in CREATE TABLE statements (DDL). e.g. CREATE TABLE XXX ( COL_A int, COL_B char(1), PRIMARY KEY (COL_A), CHECK (COL_B IN ('Y','N')) )

Overrides:
supportsCheckConstraintsInEndCreateStatements in class DatabaseAdapter
Returns:
whether we can use CHECK after the column definitions in CREATE TABLE.

isValidPrimaryKeyType

public boolean isValidPrimaryKeyType(int datatype)
Accessor for whether the specified type is allow to be part of a PK.

Specified by:
isValidPrimaryKeyType in interface RDBMSAdapter
Overrides:
isValidPrimaryKeyType in class DatabaseAdapter
Parameters:
datatype - The JDBC type
Returns:
Whether it is permitted in the PK

modOperator

public 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. The binary % operator is said to yield the remainder of its operands from an implied division; the left-hand operand is the dividend and the right-hand operand is the divisor. This returns MOD(expr1, expr2).

Specified by:
modOperator in interface org.jpox.store.mapped.DatastoreAdapter
Specified by:
modOperator in interface org.jpox.store.mapped.expression.ExpressionOperatorAdapter
Overrides:
modOperator in class org.jpox.store.mapped.AbstractDatastoreAdapter
Parameters:
operand1 - the left expression
operand2 - the right expression
Returns:
The Expression for modulus

trimMethod

public 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. It should return something like:
LTRIM(RTRIM(str))

Specified by:
trimMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
trimMethod in class DatabaseAdapter
Parameters:
str - The first argument to the trim() method.
leading - Whether to trim leading spaces
trailing - Whether to trim trailing spaces
Returns:
The text of the SQL expression.

getDatastoreDateStatement

public java.lang.String getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date.

Specified by:
getDatastoreDateStatement in interface RDBMSAdapter
Overrides:
getDatastoreDateStatement in class DatabaseAdapter
Returns:
SQL statement to get the datastore date

supportsSequences

public boolean supportsSequences()
Whether we support sequences.

Specified by:
supportsSequences in interface org.jpox.store.mapped.DatastoreAdapter
Specified by:
supportsSequences in interface RDBMSAdapter
Overrides:
supportsSequences in class org.jpox.store.mapped.AbstractDatastoreAdapter
Returns:
whether we support sequences.

getSequenceCreateStmt

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)
Accessor for the sequence statement to create the sequence.

Specified by:
getSequenceCreateStmt in interface RDBMSAdapter
Overrides:
getSequenceCreateStmt in class DatabaseAdapter
Parameters:
sequence_name - Name of the sequence
min - Minimum value for the sequence
max - Maximum value for the sequence
start - Start value for the sequence
increment - Increment value for the sequence
cache_size - Cache size for the sequence
Returns:
The statement for getting the next id from the sequence

getSequenceNextStmt

public java.lang.String getSequenceNextStmt(java.lang.String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore.

Specified by:
getSequenceNextStmt in interface RDBMSAdapter
Overrides:
getSequenceNextStmt in class DatabaseAdapter
Parameters:
sequence_name - Name of the sequence
Returns:
The statement for getting the next id for the sequence


Copyright © -2008 . All Rights Reserved.