Class MaxDBPlatform
- 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.MaxDBPlatform
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.eclipse.persistence.internal.core.databaseaccess.CorePlatform<org.eclipse.persistence.internal.helper.ConversionManager>
,org.eclipse.persistence.internal.databaseaccess.Platform
public final class MaxDBPlatform extends DatabasePlatform
Database Platform for SAP MaxDB.Usage
The MaxDB platform is configured in the persistence.xml by the following property:
<property name="eclipselink.target-database" value="MaxDB"/>
Forward mapping with EclipseLink assumes that MaxDB is configured for unicode (in version 7.7, this is the default). Unicode mode also needs to be specified in the URL as follows:
jdbc:sapdb://localhost/E32?unicode=yes
Tested with:
- DB: MaxDB, kernel 7.8.01 build 004-123-218-928
- JDBC driver: MaxDB JDBC Driver, SAP AG, 7.6.06 Build 006-000-009-234 (Make-Version: 7.8.01 Build 003-123-215-703)
- The platform class must not be used with XA transactions - see bug 329773.
- SetQueryTimeout or the hint "javax.persistence.query.timeout" do not work on MaxDB - see bug 326503.
- The hint "javax.persistence.lock.timeout" has no effect with a positive value; a value of 0 is translated to NOWAIT.
- The maximum width of an index is 1024 bytes on MaxDB. This also limits the size of a primary key. Moreover the primary key of join tables must not exceed this limit either. As it is composed of the primary key of the two tables that are joined, the combined width of the PKs of these two tables must not exceed this limit. See bug bug 326968.
- VARCHAR [UNICODE] columns do not preserve trailing spaces - see bug 327435.
- VARCHAR BYTE columns do not preserve trailing 0 bytes.
- The hint "javax.persistence.lock.timeout=0" (NOWAIT) has no effect when atempting to pessimistically lock an entity with inheritance type JOINED - see bug 326799.
- Pessimistic locking with lock scope EXTENDED should be used cautiously in the presence of foreign key constraints - see bug 327472.
- Author:
- Markus KARG (markus at headcrashing.eu), afischbach, agoerler, Sabine Heider (sabine.heider at sap.com), Konstantin Schwed (konstantin.schwed at sap.com)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZE
-
-
Constructor Summary
Constructors Constructor Description MaxDBPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueReadQuery
buildSelectQueryForSequenceObject(java.lang.String sequenceName, java.lang.Integer size)
INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).boolean
canBatchWriteWithOptimisticLocking(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call)
INTERNAL: Supports Batch Writing with Optimistic Locking.int
getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.java.lang.String
getSelectForUpdateNoWaitString()
This syntax does no wait on the lock.java.lang.String
getSelectForUpdateString()
Most database support a syntax.org.eclipse.persistence.internal.helper.DatabaseTable
getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: May override this method if the platform support temporary tables.boolean
isForUpdateCompatibleWithDistinct()
INTERNAL: Indicates whether SELECT DISTINCT ...boolean
isMaxDB()
boolean
shouldAlwaysUseTempStorageForModifyAll()
INTERNAL: That method affects UpdateAllQuery and DeleteAllQuery execution.boolean
shouldBindLiterals()
PUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.boolean
shouldOptimizeDataConversion()
Return if our driver level data conversion optimization is enabled.boolean
shouldPrintOuterJoinInWhereClause()
Some database require outer joins to be given in the where clause, others require it in the from clause.boolean
shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this.boolean
supportsIndividualTableLocking()
INTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery.boolean
supportsLocalTempTables()
INTERNAL: Indicates whether the platform supports local temporary tables.boolean
supportsNativeSequenceNumbers()
boolean
supportsSequenceObjects()
INTERNAL: Indicates whether the platform supports sequence objects.boolean
supportsStoredFunctions()
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBuildCallWithReturning, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureCallHeader, getProcedureCallTail, getProcedureEndString, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, 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, printSQLSelectStatement, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDriverName, setDriverSupportsNVarChar, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldBindAllParameters, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, supportsVPD, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarker, writeTableCreationSuffix, writeUpdateOriginalFromTempTableSql
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsIdentity, toString, usesPlatformDefaultSequence
-
-
-
-
Method Detail
-
isForUpdateCompatibleWithDistinct
public boolean isForUpdateCompatibleWithDistinct()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: Indicates whether SELECT DISTINCT ... FOR UPDATE is allowed by the platform (Oracle doesn't allow this).- Overrides:
isForUpdateCompatibleWithDistinct
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateString
public java.lang.String getSelectForUpdateString()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Most database support a syntax. although don't actually lock the row. Some require the OF some don't like it.- Overrides:
getSelectForUpdateString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateNoWaitString
public java.lang.String getSelectForUpdateNoWaitString()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This syntax does no wait on the lock. (i.e. In Oracle adding FOR UPDATE NOWAIT to the end will accomplish this)- Overrides:
getSelectForUpdateNoWaitString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsIndividualTableLocking
public boolean supportsIndividualTableLocking()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: 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:
supportsIndividualTableLocking
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldOptimizeDataConversion
public boolean shouldOptimizeDataConversion()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Return if our driver level data conversion optimization is enabled. This can be disabled as some drivers perform data conversion themselves incorrectly.- Overrides:
shouldOptimizeDataConversion
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsNativeSequenceNumbers
public final boolean supportsNativeSequenceNumbers()
- Overrides:
supportsNativeSequenceNumbers
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
buildSelectQueryForSequenceObject
public final ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String sequenceName, java.lang.Integer size)
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
INTERNAL: 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:
buildSelectQueryForSequenceObject
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getMaxFieldNameSize
public final int getMaxFieldNameSize()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.- Overrides:
getMaxFieldNameSize
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsLocalTempTables
public final boolean supportsLocalTempTables()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: 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:
supportsLocalTempTables
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getTempTableForTable
public final org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: May override this method if the platform support temporary tables.- Overrides:
getTempTableForTable
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Returns:
- DatabaseTable temorary table
-
isMaxDB
public final boolean isMaxDB()
- Specified by:
isMaxDB
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
isMaxDB
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
shouldAlwaysUseTempStorageForModifyAll
public final boolean shouldAlwaysUseTempStorageForModifyAll()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: 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:
shouldAlwaysUseTempStorageForModifyAll
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldBindLiterals
public final boolean shouldBindLiterals()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
PUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.- Overrides:
shouldBindLiterals
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintOuterJoinInWhereClause
public final boolean shouldPrintOuterJoinInWhereClause()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Some database require outer joins to be given in the where clause, others require it in the from clause.- Overrides:
shouldPrintOuterJoinInWhereClause
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldUseJDBCOuterJoinSyntax
public final boolean shouldUseJDBCOuterJoinSyntax()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.- Overrides:
shouldUseJDBCOuterJoinSyntax
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
INTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes- Overrides:
supportsSequenceObjects
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
supportsStoredFunctions
public final boolean supportsStoredFunctions()
- Overrides:
supportsStoredFunctions
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
canBatchWriteWithOptimisticLocking
public boolean canBatchWriteWithOptimisticLocking(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call)
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: Supports Batch Writing with Optimistic Locking.- Overrides:
canBatchWriteWithOptimisticLocking
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
-