public class HSQLPlatform extends DatabasePlatform
Purpose: Provides HSQL specific behavior. Support HSQL functionality as of 1.8.1.
Includes:
DEFAULT_VARCHAR_SIZE
batchWritingMechanism, castSizeForVarcharParameter, classTypes, cursorCode, DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, driverName, driverSupportsNationalCharacterVarying, fieldTypes, IS_VALID_TIMEOUT, isCastRequired, maxBatchWritingSize, partitioningCallback, pingSQL, printInnerJoinInWhereClause, printOuterJoinInWhereClause, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesOnForeignKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, storedProcedureTerminationToken, stringBindingSize, structConverters, supportsAutoCommit, tableCreationSuffix, transactionIsolation, typeConverters, useJDBCStoredProcedureSyntax, useNationalCharacterVarying, useRownumFiltering, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesStreamsForBinding, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, tableQualifier, timestampQuery
Constructor and Description |
---|
HSQLPlatform() |
Modifier and Type | Method and Description |
---|---|
protected Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL:
Returns query used to read back the value generated by Identity.
|
ValueReadQuery |
buildSelectQueryForSequenceObject(String seqName,
Integer size)
INTERNAL:
Returns query used to read value generated by sequence object (like Oracle sequence).
|
Writer |
buildSequenceObjectCreationWriter(Writer writer,
String fullSeqName,
int increment,
int start)
INTERNAL:
HSQL requires START WITH first.
|
int |
computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
INTERNAL:
Use the JDBC maxResults and firstResultIndex setting to compute a value to use when
limiting the results of a query in SQL.
|
protected String |
getCreateTempTableSqlPrefix()
INTERNAL:
Override this method if the platform supports temporary tables.
|
ValueReadQuery |
getTimestampQuery()
This method can be overridden by subclasses to return a
query that will return the timestamp from the server.
|
protected ExpressionOperator |
greatest()
INTERNAL:
Build HSQL equivalent to GREATEST(x, y)
HSQL: CASE WHEN x >= y THEN x ELSE y
|
protected void |
initializePlatformOperators()
Initialize any platform-specific operators
|
boolean |
isAlterSequenceObjectSupported()
INTERNAL:
Override this method if the platform supports sequence objects
and it's possible to alter sequence object's increment in the database.
|
boolean |
isDynamicSQLRequiredForFunctions()
INTERNAL
HSQL has some issues with using parameters on certain functions and relations.
|
boolean |
isHSQL() |
void |
printFieldIdentityClause(Writer writer)
Append the receiver's field 'identity' constraint clause to a writer.
|
void |
printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer,
org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
Print the pagination SQL using HSQL syntax "SELECT LIMIT <first> <max>".
|
protected ExpressionOperator |
rightTrim2()
INTERNAL:
Build HSQL equivalent to RTRIM(string_exp, character).
|
boolean |
shouldUseJDBCOuterJoinSyntax()
JDBC escape syntax for outer joins is not supported (not required).
|
boolean |
supportsGlobalTempTables()
INTERNAL:
Indicates whether the platform supports global temporary tables.
|
boolean |
supportsIdentity()
INTERNAL:
Indicates whether the platform supports identity.
|
boolean |
supportsNestingOuterJoins()
Does not allow nesting outer joins, i.e.
|
boolean |
supportsSequenceObjects()
INTERNAL:
Indicates whether the platform supports sequence objects.
|
boolean |
supportsUniqueColumns()
HSQL (1.8.1) does not support the UNIQUE key word in a column, but does support unique constraints defined separately.
|
static ExpressionOperator |
toNumberOperator()
INTERNAL:
Use CONVERT function for toNumber.
|
static ExpressionOperator |
trimOperator()
INTERNAL:
Use TRIM(FROM ?) function for trim.
|
void |
writeUpdateOriginalFromTempTableSql(Writer writer,
org.eclipse.persistence.internal.helper.DatabaseTable table,
Collection pkFields,
Collection assignedFields)
INTERNAL:
HSQL does not allow multiple fields to be set as a list, so each field needs to be set one by one.
|
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendBoolean, appendByteArray, appendCalendar, appendDate, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, appendTime, appendTimestamp, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, checkTableExists, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlSuffix, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureCallHeader, getProcedureCallTail, getProcedureEndString, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, getTempTableForTable, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, initializeConnectionData, isCastRequired, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, maximumNumericValues, minimumNumericValues, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldTypeSize, printFieldUnique, printFieldUnique, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, registerOutputParameter, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setClassTypes, setCursorCode, setDriverName, setDriverSupportsNVarChar, setFieldTypes, setIsCastRequired, setMaxBatchWritingSize, setNullFromDatabaseField, setNullFromDatabaseField, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceBindAllParameters, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsLockingQueriesWithMultipleTables, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, supportsVPD, supportsWaitForUpdate, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeTableCreationSuffix
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, toString, usesPlatformDefaultSequence
protected Hashtable buildFieldTypes()
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
buildFieldTypes
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
protected void initializePlatformOperators()
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
initializePlatformOperators
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public static ExpressionOperator toNumberOperator()
public static ExpressionOperator trimOperator()
protected ExpressionOperator rightTrim2()
protected ExpressionOperator greatest()
public boolean isHSQL()
isHSQL
in interface org.eclipse.persistence.internal.databaseaccess.Platform
isHSQL
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean supportsUniqueColumns()
supportsUniqueColumns
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean supportsIdentity()
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
supportsIdentity
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public ValueReadQuery buildSelectQueryForIdentity()
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
buildSelectQueryForIdentity
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public void printFieldIdentityClause(Writer writer) throws ValidationException
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
printFieldIdentityClause
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
ValidationException
public boolean isDynamicSQLRequiredForFunctions()
isDynamicSQLRequiredForFunctions
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean supportsNestingOuterJoins()
supportsNestingOuterJoins
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean supportsSequenceObjects()
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
supportsSequenceObjects
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean isAlterSequenceObjectSupported()
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
isAlterSequenceObjectSupported
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public ValueReadQuery buildSelectQueryForSequenceObject(String seqName, Integer size)
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
buildSelectQueryForSequenceObject
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean supportsGlobalTempTables()
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
supportsGlobalTempTables
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
protected String getCreateTempTableSqlPrefix()
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
getCreateTempTableSqlPrefix
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
writeUpdateOriginalFromTempTableSql
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
writer
- for writing the sqltable
- is original table for which temp table is created.pkFields
- primary key fields for the original table.assignedFields
- fields to be assigned a new value.IOException
public int computeMaxRowsForSQL(int firstResultIndex, int maxResults)
computeMaxRowsForSQL
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
MySQLPlatform
public void printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer, org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
printSQLSelectStatement
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public ValueReadQuery getTimestampQuery()
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
getTimestampQuery
in interface org.eclipse.persistence.internal.databaseaccess.Platform
getTimestampQuery
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public Writer buildSequenceObjectCreationWriter(Writer writer, String fullSeqName, int increment, int start) throws IOException
buildSequenceObjectCreationWriter
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
IOException
Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.