Class HANAPlatform
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
- org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
- org.eclipse.persistence.platform.database.DatabasePlatform
-
- org.eclipse.persistence.platform.database.HANAPlatform
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CorePlatform<ConversionManager>,Platform
public final class HANAPlatform extends DatabasePlatform
Database Platform for SAP HANA
Feature Testing
----------------------- DDL Generation - Succeeds
- Outer Join - Succeeds
- Subquery - Succeeds
- Stored Procedure Calls - Not supported
- Stored Procedure Generation - Not supported
- Native Sequences/Identifier fields - Succeeds
- JPA Bulk Update/Delete - Succeeds with Limitations
- Batch Reading - Succeeds
- Batch Writing - Succeeds
- Pessimistic Locking - Succeeds with Limitations
- First Result/Limit - Succeeds with Limitations
- Expression Framework - Succeeds with Limitations
- Delimiters - Succeeds
- Auto Detection - Succeeds
Limitations
----------------- Reserved SQL keywords cannot be used as table, column or sequence names. Use a different name, or enclose the name in double quotes. For example: @Column(name="\"LANGUAGE\"")
- Pessimistic locking adds 'FOR UPDATE' to the SELECT statement, and cannot be used with queries that use DISTINCT.
- Pessimistic locking cannot be used with queries that select from multiple tables.
- The LockNoWait option of Pessimistic Locking cannot be used; it is ignored when specified (i.e. only 'FOR UPDATE' is added to the SELECT statement).
- Bulk update and delete operations that require multiple tables to be accessed cannot be used (e.g. bulk operation on an entity that is part of an inheritance hierarchy, UpdateAll and DeleteAll queries). <li>'= NULL' and '<> NULL' cannot be used for null comparisons in the WHERE clause. Use 'IS (NOT) NULL' instead.
- Scrollable cursors are not supported.
- Query timeouts are not supported.
- Author:
- Reiner Singer (SAP AG), Sabine Heider (SAP AG)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZE
-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
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, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesOnForeignKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, storedProcedureTerminationToken, stringBindingSize, structConverters, supportsAutoCommit, tableCreationSuffix, transactionIsolation, typeConverters, Types_NCLOB, Types_SQLXML, useJDBCStoredProcedureSyntax, useNationalCharacterVarying, useRownumFiltering, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesStreamsForBinding, usesStringBinding
-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery
-
-
Constructor Summary
Constructors Constructor Description HANAPlatform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCalendar(java.util.Calendar calendar, java.io.Writer writer)Answer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation.protected voidappendDate(java.sql.Date date, java.io.Writer writer)Answer a platform correct string representation of a Date, suitable for SQL generation.protected voidappendTime(java.sql.Time time, java.io.Writer writer)Answer a platform correct string representation of a Time, suitable for SQL generation.protected voidappendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer)Answer a platform correct string representation of a Timestamp, suitable for SQL generation.protected java.util.HashtablebuildFieldTypes()Return the mapping of class types to database types for the schema framework.ValueReadQuerybuildSelectQueryForSequenceObject(java.lang.String sequenceName, java.lang.Integer size)INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).booleancanBatchWriteWithOptimisticLocking(DatabaseCall call)INTERNAL: Supports Batch Writing with Optimistic Locking.intcomputeMaxRowsForSQL(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.static ExpressionOperatorcreateLocate2Operator()INTERNAL: Build locate operator with 3 params i.e.static ExpressionOperatorcreateLocateOperator()INTERNAL: Build locate operator i.e.intexecuteBatch(java.sql.Statement statement, boolean isStatementPrepared)Internal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes.protected java.lang.StringgetCreateTempTableSqlPrefix()INTERNAL: Override this method if the platform supports temporary tables.java.lang.StringgetInputProcedureToken()Used for stored procedure creation: Prefix for INPUT parameters.intgetMaxFieldNameSize()INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.java.lang.StringgetOutputProcedureToken()This method is used to print the output parameter token when stored procedures are calledjava.lang.StringgetProcedureCallHeader()Used for sp calls.java.lang.StringgetProcedureCallTail()Used for sp calls.DatabaseTablegetTempTableForTable(DatabaseTable table)INTERNAL: May override this method if the platform support temporary tables.protected voidinitializePlatformOperators()Initialize any platform-specific operatorsbooleanisForUpdateCompatibleWithDistinct()INTERNAL: Indicates whether SELECT DISTINCT ...booleanisHANA()protected voidprintFieldTypeSize(java.io.Writer writer, FieldDefinition field, FieldTypeDefinition fieldType)voidprintSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.booleanrequiresUniqueConstraintCreationOnTableCreate()Used for table creation.booleanshouldAlwaysUseTempStorageForModifyAll()INTERNAL: That method affects UpdateAllQuery and DeleteAllQuery execution.booleanshouldBindLiterals()PUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.booleanshouldOptimizeDataConversion()Return if our driver level data conversion optimization is enabled.booleanshouldPrintOuterJoinInWhereClause()Some database require outer joins to be given in the where clause, others require it in the from clause.booleanshouldPrintStoredProcedureArgumentNameInCall()INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g.protected booleanshouldTempTableSpecifyPrimaryKeys()INTERNAL: Indicates whether temporary table can specify primary keys (some platforms don't allow that).booleanshouldUseJDBCOuterJoinSyntax()JDBC defines and outer join syntax, many drivers do not support this.booleansupportsForeignKeyConstraints()booleansupportsGlobalTempTables()INTERNAL: Indicates whether the platform supports global temporary tables.booleansupportsIndividualTableLocking()INTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery.booleansupportsLocalTempTables()INTERNAL: Indicates whether the platform supports local temporary tables.booleansupportsNativeSequenceNumbers()booleansupportsSequenceObjects()INTERNAL: Indicates whether the platform supports sequence objects.booleansupportsStoredFunctions()booleanusesStringBinding()voidwriteAddColumnClause(java.io.Writer writer, AbstractSession session, TableDefinition table, FieldDefinition field)INTERNAL: May need to override this method if the platform supports ALTER TABLE ADD <column> and the generated sql doesn't work.-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowBindingForSelectClause, allowsSizeInProcedureArguments, appendBoolean, appendByteArray, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBuildCallWithReturning, checkTableExists, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, 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, getIdentifierQuoteCharacter, getIndexNamePrefix, getInOutputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgument, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureEndString, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, initializeConnectionData, isAlterSequenceObjectSupported, isCastRequired, isDynamicSQLRequiredForFunctions, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, maximumNumericValues, minimumNumericValues, minimumTimeIncrement, prepareBatchStatement, printFieldIdentityClause, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printFieldUnique, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, registerOutputParameter, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setClassTypes, setCursorCode, setDriverName, setDriverSupportsNVarChar, setFieldTypes, setIsCastRequired, setMaxBatchWritingSize, setNullFromDatabaseField, setNullFromDatabaseField, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldBindPartialParameters, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceBindAllParameters, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldBindAllParameters, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsIndexes, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, supportsVPD, supportsWaitForUpdate, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, wasFailureCommunicationBased, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeTableCreationSuffix, writeUpdateOriginalFromTempTableSql
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsIdentity, supportsReturnGeneratedKeys, toString, usesPlatformDefaultSequence
-
-
-
-
Method Detail
-
isHANA
public boolean isHANA()
- Specified by:
isHANAin interfacePlatform- Overrides:
isHANAin classDatasourcePlatform
-
usesStringBinding
public boolean usesStringBinding()
- Overrides:
usesStringBindingin classDatabasePlatform
-
requiresUniqueConstraintCreationOnTableCreate
public boolean requiresUniqueConstraintCreationOnTableCreate()
Description copied from class:DatabasePlatformUsed for table creation. If a database platform does not support ALTER TABLE syntax to add/drop unique constraints (like Symfoware), overriding this method will allow the constraint to be specified in the CREATE TABLE statement. This only affects unique constraints specified using the UniqueConstraint annotation or equivalent method. Columns for which the 'unique' attribute is set to true will be declared 'UNIQUE' in the CREATE TABLE statement regardless of the return value of this method.- Overrides:
requiresUniqueConstraintCreationOnTableCreatein classDatabasePlatform- Returns:
- whether unique constraints should be declared as part of the CREATE TABLE statement instead of in separate ALTER TABLE ADD/DROP statements.
-
isForUpdateCompatibleWithDistinct
public boolean isForUpdateCompatibleWithDistinct()
Description copied from class:DatabasePlatformINTERNAL: Indicates whether SELECT DISTINCT ... FOR UPDATE is allowed by the platform (Oracle doesn't allow this).- Overrides:
isForUpdateCompatibleWithDistinctin classDatabasePlatform
-
supportsIndividualTableLocking
public boolean supportsIndividualTableLocking()
Description copied from class:DatabasePlatformINTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery. Example: the following locks the rows in SALARY table, doesn't lock the rows in EMPLOYEE table: on Oracle platform (method returns true): SELECT t0.EMP_ID..., t1.SALARY FROM EMPLOYEE t0, SALARY t1 WHERE ... FOR UPDATE t1.SALARY on SQLServer platform (method returns true): SELECT t0.EMP_ID..., t1.SALARY FROM EMPLOYEE t0, SALARY t1 WITH (UPDLOCK) WHERE ...- Overrides:
supportsIndividualTableLockingin classDatabasePlatform
-
buildFieldTypes
protected final java.util.Hashtable buildFieldTypes()
Description copied from class:DatabasePlatformReturn the mapping of class types to database types for the schema framework.- Overrides:
buildFieldTypesin classDatabasePlatform
-
printFieldTypeSize
protected void printFieldTypeSize(java.io.Writer writer, FieldDefinition field, FieldTypeDefinition fieldType) throws java.io.IOException- Overrides:
printFieldTypeSizein classDatabasePlatform- Throws:
java.io.IOException
-
initializePlatformOperators
protected final void initializePlatformOperators()
Description copied from class:DatasourcePlatformInitialize any platform-specific operators- Overrides:
initializePlatformOperatorsin classDatasourcePlatform
-
createLocateOperator
public static ExpressionOperator createLocateOperator()
INTERNAL: Build locate operator i.e. LOCATE("ob", t0.F_NAME)
-
createLocate2Operator
public static ExpressionOperator createLocate2Operator()
INTERNAL: Build locate operator with 3 params i.e. LOCATE("coffee", t0.DESCRIP, 4). Last parameter is a start at.
-
printSQLSelectStatement
public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)
Description copied from class:DatabasePlatformINTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.- Overrides:
printSQLSelectStatementin classDatabasePlatform
-
computeMaxRowsForSQL
public int computeMaxRowsForSQL(int firstResultIndex, int maxResults)Description copied from class:DatabasePlatformINTERNAL: Use the JDBC maxResults and firstResultIndex setting to compute a value to use when limiting the results of a query in SQL. These limits tend to be used in two ways. 1. MaxRows is the index of the last row to be returned (like JDBC maxResults) 2. MaxRows is the number of rows to be returned By default, we assume case 1 and simply return the value of maxResults. Subclasses may provide an override- Overrides:
computeMaxRowsForSQLin classDatabasePlatform- See Also:
MySQLPlatform
-
shouldOptimizeDataConversion
public boolean shouldOptimizeDataConversion()
Description copied from class:DatabasePlatformReturn if our driver level data conversion optimization is enabled. This can be disabled as some drivers perform data conversion themselves incorrectly.- Overrides:
shouldOptimizeDataConversionin classDatabasePlatform
-
supportsNativeSequenceNumbers
public final boolean supportsNativeSequenceNumbers()
- Overrides:
supportsNativeSequenceNumbersin classDatasourcePlatform
-
buildSelectQueryForSequenceObject
public final ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String sequenceName, java.lang.Integer size)
Description copied from class:DatasourcePlatformINTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). In case the other version of this method (taking no parameters) returns null, this method is called every time sequence object NativeSequence reads. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.- Overrides:
buildSelectQueryForSequenceObjectin classDatasourcePlatform
-
supportsGlobalTempTables
public final boolean supportsGlobalTempTables()
Description copied from class:DatabasePlatformINTERNAL: Indicates whether the platform supports global temporary tables. "Global" means that an attempt to create temporary table with the same name for the second time results in exception. EclipseLink attempts to create global temporary table in the beginning of UpdateAllQuery, execution and assumes that it already exists in case SQLException results. In the end of UpdateAllQuery execution all rows are removed from the temporary table - it is necessary in case the same temporary table will be used by another UpdateAllQuery in the same transaction. Override this method if the platform supports global temporary tables. Note that this method is ignored in case supportsLocalTempTables() returns true.- Overrides:
supportsGlobalTempTablesin classDatabasePlatform
-
getCreateTempTableSqlPrefix
protected final java.lang.String getCreateTempTableSqlPrefix()
Description copied from class:DatabasePlatformINTERNAL: Override this method if the platform supports temporary tables. This should contain the beginning of sql string for creating temporary table - the sql statement name, for instance: "CREATE GLOBAL TEMPORARY TABLE ". Don't forget to end it with a space.- Overrides:
getCreateTempTableSqlPrefixin classDatabasePlatform
-
getTempTableForTable
public DatabaseTable getTempTableForTable(DatabaseTable table)
Description copied from class:DatabasePlatformINTERNAL: May override this method if the platform support temporary tables.- Overrides:
getTempTableForTablein classDatabasePlatform- Returns:
- DatabaseTable temorary table
-
shouldTempTableSpecifyPrimaryKeys
protected boolean shouldTempTableSpecifyPrimaryKeys()
Description copied from class:DatabasePlatformINTERNAL: Indicates whether temporary table can specify primary keys (some platforms don't allow that). Used by writeCreateTempTableSql method.- Overrides:
shouldTempTableSpecifyPrimaryKeysin classDatabasePlatform
-
getMaxFieldNameSize
public final int getMaxFieldNameSize()
Description copied from class:DatabasePlatformINTERNAL: returns the maximum number of characters that can be used in a field name on this platform.- Overrides:
getMaxFieldNameSizein classDatabasePlatform
-
supportsLocalTempTables
public final boolean supportsLocalTempTables()
Description copied from class:DatabasePlatformINTERNAL: Indicates whether the platform supports local temporary tables. "Local" means that several threads may create temporary tables with the same name. Local temporary table is created in the beginning of UpdateAllQuery execution and dropped in the end of it. Override this method if the platform supports local temporary tables.- Overrides:
supportsLocalTempTablesin classDatabasePlatform
-
shouldAlwaysUseTempStorageForModifyAll
public final boolean shouldAlwaysUseTempStorageForModifyAll()
Description copied from class:DatabasePlatformINTERNAL: That method affects UpdateAllQuery and DeleteAllQuery execution. In case it returns false modify all queries would attempt to proceed without using temporary storage if it is possible. In case it returns true modify all queries would use temporary storage unless each modify statement doesn't reference any other tables. May need to override this method if the platform can't handle the sql generated for modify all queries without using temporary storage.- Overrides:
shouldAlwaysUseTempStorageForModifyAllin classDatabasePlatform
-
shouldBindLiterals
public final boolean shouldBindLiterals()
Description copied from class:DatabasePlatformPUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.- Overrides:
shouldBindLiteralsin classDatabasePlatform
-
shouldPrintOuterJoinInWhereClause
public final boolean shouldPrintOuterJoinInWhereClause()
Description copied from class:DatabasePlatformSome database require outer joins to be given in the where clause, others require it in the from clause.- Overrides:
shouldPrintOuterJoinInWhereClausein classDatabasePlatform
-
shouldUseJDBCOuterJoinSyntax
public final boolean shouldUseJDBCOuterJoinSyntax()
Description copied from class:DatabasePlatformJDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.- Overrides:
shouldUseJDBCOuterJoinSyntaxin classDatabasePlatform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
Description copied from class:DatasourcePlatformINTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes- Overrides:
supportsSequenceObjectsin classDatasourcePlatform
-
canBatchWriteWithOptimisticLocking
public boolean canBatchWriteWithOptimisticLocking(DatabaseCall call)
Description copied from class:DatabasePlatformINTERNAL: Supports Batch Writing with Optimistic Locking.- Overrides:
canBatchWriteWithOptimisticLockingin classDatabasePlatform
-
executeBatch
public int executeBatch(java.sql.Statement statement, boolean isStatementPrepared) throws java.sql.SQLExceptionDescription copied from class:DatabasePlatformInternal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes.- Overrides:
executeBatchin classDatabasePlatformisStatementPrepared- - flag is set to true if this statement is prepared- Returns:
- - number of rows modified/deleted by this statement
- Throws:
java.sql.SQLException
-
supportsForeignKeyConstraints
public boolean supportsForeignKeyConstraints()
- Overrides:
supportsForeignKeyConstraintsin classDatabasePlatform
-
getInputProcedureToken
public java.lang.String getInputProcedureToken()
Used for stored procedure creation: Prefix for INPUT parameters. Not required on most platforms.- Overrides:
getInputProcedureTokenin classDatabasePlatform
-
getOutputProcedureToken
public java.lang.String getOutputProcedureToken()
This method is used to print the output parameter token when stored procedures are called- Overrides:
getOutputProcedureTokenin classDatabasePlatform
-
getProcedureCallTail
public java.lang.String getProcedureCallTail()
Used for sp calls.- Overrides:
getProcedureCallTailin classDatabasePlatform
-
shouldPrintStoredProcedureArgumentNameInCall
public boolean shouldPrintStoredProcedureArgumentNameInCall()
INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g. EXECUTE PROCEDURE MyStoredProc(myvariable = ?)- Overrides:
shouldPrintStoredProcedureArgumentNameInCallin classDatabasePlatform
-
supportsStoredFunctions
public boolean supportsStoredFunctions()
- Overrides:
supportsStoredFunctionsin classDatabasePlatform
-
appendDate
protected void appendDate(java.sql.Date date, java.io.Writer writer) throws java.io.IOExceptionDescription copied from class:DatabasePlatformAnswer a platform correct string representation of a Date, suitable for SQL generation. The date is printed in the ODBC platform independent format {d 'yyyy-mm-dd'}.- Overrides:
appendDatein classDatabasePlatform- Throws:
java.io.IOException
-
appendTime
protected void appendTime(java.sql.Time time, java.io.Writer writer) throws java.io.IOExceptionDescription copied from class:DatabasePlatformAnswer a platform correct string representation of a Time, suitable for SQL generation. The time is printed in the ODBC platform independent format {t'hh:mm:ss'}.- Overrides:
appendTimein classDatabasePlatform- Throws:
java.io.IOException
-
appendTimestamp
protected void appendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer) throws java.io.IOExceptionDescription copied from class:DatabasePlatformAnswer a platform correct string representation of a Timestamp, suitable for SQL generation. The timestamp is printed in the ODBC platform independent timestamp format {ts'YYYY-MM-DD HH:MM:SS.NNNNNNNNN'}.- Overrides:
appendTimestampin classDatabasePlatform- Throws:
java.io.IOException
-
appendCalendar
protected void appendCalendar(java.util.Calendar calendar, java.io.Writer writer) throws java.io.IOExceptionDescription copied from class:DatabasePlatformAnswer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation. The calendar is printed in the ODBC platform independent timestamp format {ts'YYYY-MM-DD HH:MM:SS.NNNNNNNNN'}.- Overrides:
appendCalendarin classDatabasePlatform- Throws:
java.io.IOException
-
writeAddColumnClause
public void writeAddColumnClause(java.io.Writer writer, AbstractSession session, TableDefinition table, FieldDefinition field) throws java.io.IOExceptionDescription copied from class:DatabasePlatformINTERNAL: May need to override this method if the platform supports ALTER TABLE ADD <column> and the generated sql doesn't work. Write the string that follows ALTER TABLE to create a sql statement for the platform in order to append a new column to an existing table.- Overrides:
writeAddColumnClausein classDatabasePlatform- Throws:
java.io.IOException
-
getProcedureCallHeader
public java.lang.String getProcedureCallHeader()
Description copied from class:DatabasePlatformUsed for sp calls.- Overrides:
getProcedureCallHeaderin classDatabasePlatform
-
-