org.jpox.store.rdbms.adapter
Class DerbyAdapter

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.DerbyAdapter
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 DerbyAdapter
extends DatabaseAdapter

Provides methods for adapting SQL language elements to the Cloudscape/Derby 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.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
DerbyAdapter(java.sql.DatabaseMetaData metadata)
          Constructs an Apache Derby adapter based on the given JDBC metadata.
 
Method Summary
 org.jpox.store.mapped.expression.ScalarExpression concatOperator(org.jpox.store.mapped.expression.ScalarExpression operand1, org.jpox.store.mapped.expression.ScalarExpression operand2)
           If only one operand expression is of type String, then string conversion is performed on the other operand to produce a string at run time.
 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 getCatalogName(java.sql.Connection conn)
          Accessor for the catalog name.
 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 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.
 java.lang.String getSchemaName(java.sql.Connection conn)
          Accessor for the schema name.
 java.lang.String getVendorID()
          Accessor for the vendor id.
 void initialiseDatastore(java.lang.Object conn)
          Creates the auxiliary functions/procedures in the schema
 boolean isIdentityFieldDataType(java.lang.String columnDef)
          Verifies if the given columnDef is auto incremented by the datastore.
 org.jpox.store.mapped.expression.NumericExpression lengthMethod(org.jpox.store.mapped.expression.StringExpression str)
          Returns the appropriate SQL expression for the JDOQL String.length() method.
 org.jpox.store.mapped.expression.BooleanExpression matchesMethod(org.jpox.store.mapped.expression.StringExpression text, org.jpox.store.mapped.expression.StringExpression pattern)
          Matches this to the argument expression pattern.
 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)
          Returns a new TableExpression object appropriate for this DBMS.
 TypeInfo newTypeInfo(java.sql.ResultSet rs)
          Method to add a new type.
 org.jpox.store.mapped.expression.BooleanExpression startsWithMethod(org.jpox.store.mapped.expression.ScalarExpression source, org.jpox.store.mapped.expression.ScalarExpression str)
          Method to handle the starts with operation.
 org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str, org.jpox.store.mapped.expression.NumericExpression begin)
          Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method.
 org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str, org.jpox.store.mapped.expression.NumericExpression begin, org.jpox.store.mapped.expression.NumericExpression end)
          Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method.
 boolean supportsAnalysisMethods()
          Accessor for whether the SQL extensions CUBE, ROLLUP are supported.
 boolean supportsDefaultKeywordWithNotNullInColumnOptions()
          Whether we support DEFAULT tag together with NOT NULL in CREATE TABLE statements.
 boolean supportsDeferredConstraints()
          Accessor for whether Cloudscape supports deferred constraints.
 boolean supportsIdentityFields()
          Whether we support auto-increment fields.
 boolean supportsLockWithSelectForUpdate()
          Whether this datastore supports SELECT ...
 boolean supportsNullsInCandidateKeys()
          Whether we support NULLs in candidate keys.
 boolean supportsNullsKeywordInColumnOptions()
          Whether the database support NULLs in the column options for table creation.
 org.jpox.store.mapped.expression.NumericExpression toNumericExpression(org.jpox.store.mapped.expression.CharacterExpression expr)
          Returns the appropriate expression for the (int)'A' expression.
 org.jpox.store.mapped.expression.StringExpression toStringExpression(org.jpox.store.mapped.expression.NumericExpression expr)
          A String conversion that converts a numeric expression to string.
 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, cosMethod, createIndexesBeforeForeignKeys, endsWithMethod, expMethod, floorMethod, getAddCandidateKeyStatement, getAddColumnStatement, getAddForeignKeyStatement, getAddPrimaryKeyStatement, getCatalogSeparator, getCharColumnsPaddedWithSpaces, getCheckConstraintForValues, getColumns, getColumns, getConnection, getContinuationString, getCreateIndexStatement, getCreateTableStatement, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDayMethod, getDriverMajorVersion, getDriverMinorVersion, getDropViewStatement, getEscapeCharacter, getEscapedPatternExpression, getEscapePatternExpression, getExistingIndexes, getHourMethod, getMaxColumnNameLength, getMaxForeignKeys, getMaxIndexes, getMaxTableNameLength, getMinuteMethod, getMonthMethod, getNewMappingManager, getNewUUIDFunction, getNonAnsiInnerJoinWhereClause, getNonAnsiLeftOuterJoinWhereClause, getNonAnsiRightOuterJoinWhereClause, getOperatorConcat, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters, getPlaceWithOptionAfterFromClause, getPlaceWithOptionWithinJoinClauses, getRangeByLimitSelectClause, getRangeByLimitWhereClause, getRangeByRowNumberColumn, getRequiredTransactionIsolationLevel, getSecondMethod, getSelectNewUUIDStmt, getSelectWithLockOption, getSequenceCreateStmt, getSequenceNextStmt, getSupportsPersistOfUnassignedChar, getSurrogateForEmptyStrings, getTables, getTransactionIsolationForSchemaCreation, getTypeInfo, getUnlimitedLengthPrecisionValue, getYearMethod, includeOrderByColumnsInSelect, indexOfMethod, isNullEqualsEmptyStrings, isSQLKeyword, isStoresLowerCaseIdentifiers, isStoresLowerCaseQuotedIdentifiers, isStoresMixedCaseIdentifiers, isStoresMixedCaseQuotedIdentifiers, isStoresUpperCaseIdentifiers, isStoresUpperCaseQuotedIdentifiers, isValidPrimaryKeyType, iteratorReservedWords, iteratorTypeInfo, loadDatastoreMapping, logConfiguration, logMethod, newColumnInfo, newExportedKeyInfo, newForeignKeyInfo, newQueryStatement, newQueryStatement, parseKeywordList, requiresColumnDefaultsInitialising, setDefaultTypeInfoForJDBCType, sinMethod, sqrtMethod, supportsAlterTableDropConstraint, supportsAlterTableDropForeignKeyConstraint, supportsAnsiJoinSyntax, supportsAutoIncrementColumnTypeSpecification, supportsAutoIncrementKeysNullSpecification, supportsBooleanComparison, supportsCatalogsInTableDefinitions, supportsCheckConstraintsInEndCreateStatements, supportsCheckInCreateStatements, supportsDefaultBeforeNullInColumnOptions, supportsDefaultKeywordInColumnOptions, supportsDistinctWithSelectForUpdate, supportsEscapeExpressionInLikePredicate, supportsExistsSyntax, supportsForeignKeyDeleteAction, supportsForeignKeyUpdateAction, supportsPrimaryKeyInCreateStatements, supportsProjectionInTableReferenceJoins, supportsSchemasInTableDefinitions, supportsSettingBlobUsingSetString, supportsSettingClobUsingSetString, supportsStatementBatching, supportsStatementGetGeneratedKeys, supportsTransactionIsolationLevel, supportsUnionSyntax, supportsUniqueConstraintsInEndCreateStatements, tanMethod, toString, 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, 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

DerbyAdapter

public DerbyAdapter(java.sql.DatabaseMetaData metadata)
Constructs an Apache Derby adapter based on the given JDBC metadata.

Parameters:
metadata - the database metadata.
Method Detail

initialiseDatastore

public void initialiseDatastore(java.lang.Object conn)
Creates the auxiliary functions/procedures in the schema

Specified by:
initialiseDatastore in interface org.jpox.store.mapped.DatastoreAdapter
Overrides:
initialiseDatastore in class DatabaseAdapter
Parameters:
conn - the connection to the datastore

getSchemaName

public java.lang.String getSchemaName(java.sql.Connection conn)
                               throws java.sql.SQLException
Accessor for the schema name.

Specified by:
getSchemaName in interface RDBMSAdapter
Overrides:
getSchemaName in class DatabaseAdapter
Parameters:
conn - The Connection to use
Returns:
The schema name used by this connection
Throws:
java.sql.SQLException

getCatalogName

public java.lang.String getCatalogName(java.sql.Connection conn)
                                throws java.sql.SQLException
Accessor for the catalog name.

Specified by:
getCatalogName in interface RDBMSAdapter
Overrides:
getCatalogName in class DatabaseAdapter
Parameters:
conn - The Connection to use
Returns:
The catalog name used by this connection
Throws:
java.sql.SQLException

getVendorID

public java.lang.String getVendorID()
Accessor for the vendor id.

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

newTypeInfo

public TypeInfo newTypeInfo(java.sql.ResultSet rs)
Method to add a new type.

Overrides:
newTypeInfo in class DatabaseAdapter
Parameters:
rs - ResultSet containing the type info.
Returns:
The TypeInfo

supportsDeferredConstraints

public boolean supportsDeferredConstraints()
Accessor for whether Cloudscape supports deferred constraints.

Specified by:
supportsDeferredConstraints in interface RDBMSAdapter
Overrides:
supportsDeferredConstraints in class DatabaseAdapter
Returns:
Whether it supports deferred constraints

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)
Description copied from class: DatabaseAdapter
Returns a new TableExpression object appropriate for this DBMS. This should be an instance of one of the three built-in styles of table expression: TableExprAsSubjoins is the default, which arguably produces the most readable SQL but doesn't work on all DBMS's. TableExprAsSubjoins should work anywhere, but may be less efficient.

Specified by:
newTableExpression in interface RDBMSAdapter
Overrides:
newTableExpression in class DatabaseAdapter
Parameters:
qs - The query statement in which the table expression will be included.
table - The main table in the expression.
rangeVar - The SQL alias, or "range variable", to assign to the expression or to the main table.
Returns:
The expression

getDropTableStatement

public java.lang.String getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
Description copied from class: DatabaseAdapter
Returns the appropriate SQL to drop the given table. It should return something like:

 DROP TABLE FOO CASCADE
 

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

supportsNullsKeywordInColumnOptions

public boolean supportsNullsKeywordInColumnOptions()
Whether the database support NULLs in the column options for table creation. By default all columns are nullable in DB2, and the keyword NULL in the column options are not supported

Specified by:
supportsNullsKeywordInColumnOptions in interface RDBMSAdapter
Overrides:
supportsNullsKeywordInColumnOptions in class DatabaseAdapter
Returns:
whether the database support NULLs in the column options for table creation.

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

lengthMethod

public org.jpox.store.mapped.expression.NumericExpression lengthMethod(org.jpox.store.mapped.expression.StringExpression str)
Description copied from class: DatabaseAdapter
Returns the appropriate SQL expression for the JDOQL String.length() method. It should return something like:

 CHAR_LENGTH(str)
 

Specified by:
lengthMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
lengthMethod in class DatabaseAdapter
Parameters:
str - The argument to the length() method.
Returns:
The text of the SQL expression.

substringMethod

public org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str,
                                                                         org.jpox.store.mapped.expression.NumericExpression begin)
Description copied from class: DatabaseAdapter
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. It should return something like:

 SUBSTRING(str FROM begin)
 
Note that the value of begin is base 0(Java-style), while most SQL string functions use base 1.

Specified by:
substringMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
substringMethod in class DatabaseAdapter
Parameters:
str - The first argument to the substring() method.
begin - The second argument to the substring() method.
Returns:
The text of the SQL expression.

substringMethod

public org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str,
                                                                         org.jpox.store.mapped.expression.NumericExpression begin,
                                                                         org.jpox.store.mapped.expression.NumericExpression end)
Description copied from class: DatabaseAdapter
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. It should return something like:

 SUBSTRING(str FROM begin FOR len)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.

Specified by:
substringMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
substringMethod in class DatabaseAdapter
Parameters:
str - The first argument to the substring() method.
begin - The second argument to the substring() method.
end - The third argument to the substring() method.
Returns:
The text of the SQL expression.

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.

startsWithMethod

public org.jpox.store.mapped.expression.BooleanExpression startsWithMethod(org.jpox.store.mapped.expression.ScalarExpression source,
                                                                           org.jpox.store.mapped.expression.ScalarExpression str)
Method to handle the starts with operation.

Specified by:
startsWithMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
startsWithMethod in class DatabaseAdapter
Parameters:
source - The expression with the searched string
str - The expression for the search string
Returns:
The expression.

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

isIdentityFieldDataType

public boolean isIdentityFieldDataType(java.lang.String columnDef)
Verifies if the given columnDef is auto incremented by the datastore.

Specified by:
isIdentityFieldDataType in interface org.jpox.store.mapped.DatastoreAdapter
Overrides:
isIdentityFieldDataType in class DatabaseAdapter
Parameters:
columnDef - the datastore type name
Returns:
true when the columnDef has values auto incremented by the datastore

supportsIdentityFields

public boolean supportsIdentityFields()
Whether we support auto-increment fields.

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

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

supportsDefaultKeywordWithNotNullInColumnOptions

public boolean supportsDefaultKeywordWithNotNullInColumnOptions()
Whether we support DEFAULT tag together with NOT NULL in CREATE TABLE statements.
 CREATE TABLE X ( MEMORY_SIZE BIGINT DEFAULT 0 NOT NULL )
 
Some databases only support DEFAULT {ConstantExpression | NULL}

Specified by:
supportsDefaultKeywordWithNotNullInColumnOptions in interface RDBMSAdapter
Overrides:
supportsDefaultKeywordWithNotNullInColumnOptions in class DatabaseAdapter
Returns:
whether we support the DEFAULT tag together with NOT NULL in CREATE TABLE

supportsLockWithSelectForUpdate

public boolean supportsLockWithSelectForUpdate()
Whether this datastore supports SELECT ... FOR UPDATE.

Specified by:
supportsLockWithSelectForUpdate in interface RDBMSAdapter
Overrides:
supportsLockWithSelectForUpdate in class DatabaseAdapter
Returns:
whether we support SELECT ... FOR UPDATE.

supportsNullsInCandidateKeys

public boolean supportsNullsInCandidateKeys()
Whether we support NULLs in candidate keys.

Specified by:
supportsNullsInCandidateKeys in interface RDBMSAdapter
Overrides:
supportsNullsInCandidateKeys in class DatabaseAdapter
Returns:
whether we support NULLs in candidate keys.

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.

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

toNumericExpression

public org.jpox.store.mapped.expression.NumericExpression toNumericExpression(org.jpox.store.mapped.expression.CharacterExpression expr)
Returns the appropriate expression for the (int)'A' expression. In SQL, it should compile something like:

 ASCII('A')
 

Specified by:
toNumericExpression in interface org.jpox.store.mapped.expression.ExpressionConversionAdapter
Overrides:
toNumericExpression in class DatabaseAdapter
Parameters:
expr - The CharacterExpression
Returns:
The NumericExpression

toStringExpression

public org.jpox.store.mapped.expression.StringExpression toStringExpression(org.jpox.store.mapped.expression.NumericExpression expr)
A String conversion that converts a numeric expression to string. If the expr argument represents a Literal value, converts to a Literal string. In SQL, it should compile something like:

 CAST(999999 AS VARCHAR(4000))
 

Specified by:
toStringExpression in interface org.jpox.store.mapped.expression.ExpressionConversionAdapter
Overrides:
toStringExpression in class DatabaseAdapter
Parameters:
expr - The NumericExpression
Returns:
the StringExpression

concatOperator

public org.jpox.store.mapped.expression.ScalarExpression concatOperator(org.jpox.store.mapped.expression.ScalarExpression operand1,
                                                                        org.jpox.store.mapped.expression.ScalarExpression operand2)

If only one operand expression is of type String, then string conversion is performed on the other operand to produce a string at run time. The result is a reference to a String object (newly created, unless the expression is a compile-time constant expression (§15.28))that is the concatenation of the two operand strings. The characters of the left-hand operand precede the characters of the right-hand operand in the newly created string. If an operand of type String is null, then the string "null" is used instead of that operand. "null" is used instead of that operand.

Concatenates two or more character or binary strings, columns, or a combination of strings and column names into one expression (a string operator).

Specified by:
concatOperator in interface org.jpox.store.mapped.expression.ExpressionOperatorAdapter
Overrides:
concatOperator in class DatabaseAdapter
Parameters:
operand1 - the left expression
operand2 - the right expression
Returns:
The Expression for concatenation

matchesMethod

public org.jpox.store.mapped.expression.BooleanExpression matchesMethod(org.jpox.store.mapped.expression.StringExpression text,
                                                                        org.jpox.store.mapped.expression.StringExpression pattern)
Matches this to the argument expression pattern. Use "." to find any character and ".*" for wildcard matches. A global case-insensitive flag "(?i)" can be set for the pattern. If used, the global case-insensitive flag must prefix the pattern. The pattern passed to matches must be a literal or parameter.

Specified by:
matchesMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapter
Overrides:
matchesMethod in class DatabaseAdapter
Parameters:
text - The argument to the length() method.
pattern - The literal expression with the pattern.
Returns:
the match 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


Copyright © -2008 . All Rights Reserved.