Module org.eclipse.persistence.core
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:
Serializable,Cloneable,CorePlatform<ConversionManager>,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=yesTested 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 "jakarta.persistence.query.timeout" do not work on MaxDB - see bug 326503.
- The hint "jakarta.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 "jakarta.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
-
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, 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, uuidQuery
-
-
Constructor Summary
Constructors Constructor Description MaxDBPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Hashtable<Class<?>,FieldTypeDefinition>buildFieldTypes()Return the mapping of class types to database types for the schema framework.ValueReadQuerybuildSelectQueryForSequenceObject(String sequenceName, 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.protected StringgetCreateTempTableSqlPrefix()INTERNAL: Override this method if the platform supports temporary tables.intgetMaxFieldNameSize()INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.StringgetSelectForUpdateNoWaitString()This syntax does no wait on the lock.StringgetSelectForUpdateString()Most database support a syntax.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 ...booleanisMaxDB()protected voidprintFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType)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.booleanshouldUseJDBCOuterJoinSyntax()JDBC defines and outer join syntax, many drivers do not support this.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()-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowBindingForSelectClause, 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, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBuildCallWithReturning, checkTableExists, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, 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, getJsonPlatform, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureCallHeader, getProcedureCallTail, getProcedureEndString, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateOfString, 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, printSQLSelectStatement, 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, 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, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, 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, 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, getDriverVersion, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, getUUIDQuery, hasDefaultSequence, initializeDefaultQueries, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMariaDB, isMySQL, isODBC, isOracle, isOracle12, isOracle23, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, setUUIDQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsIdentity, supportsReturnGeneratedKeys, toString, usesPlatformDefaultSequence
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.internal.databaseaccess.Platform
connectionProperties
-
-
-
-
Method Detail
-
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
-
getSelectForUpdateString
public String getSelectForUpdateString()
Description copied from class:DatabasePlatformMost database support a syntax. although don't actually lock the row. Some require the OF some don't like it.- Overrides:
getSelectForUpdateStringin classDatabasePlatform
-
getSelectForUpdateNoWaitString
public String getSelectForUpdateNoWaitString()
Description copied from class:DatabasePlatformThis syntax does no wait on the lock. (i.e. In Oracle adding FOR UPDATE NOWAIT to the end will accomplish this)- Overrides:
getSelectForUpdateNoWaitStringin classDatabasePlatform
-
buildFieldTypes
protected Hashtable<Class<?>,FieldTypeDefinition> buildFieldTypes()
Description copied from class:DatabasePlatformReturn the mapping of class types to database types for the schema framework.- Overrides:
buildFieldTypesin 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
-
printFieldTypeSize
protected void printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType) throws IOException
- Overrides:
printFieldTypeSizein classDatabasePlatform- Throws:
IOException
-
initializePlatformOperators
protected void initializePlatformOperators()
Description copied from class:DatasourcePlatformInitialize any platform-specific operators- Overrides:
initializePlatformOperatorsin classDatasourcePlatform
-
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 boolean supportsNativeSequenceNumbers()
- Overrides:
supportsNativeSequenceNumbersin classDatasourcePlatform
-
buildSelectQueryForSequenceObject
public ValueReadQuery buildSelectQueryForSequenceObject(String sequenceName, 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
-
getCreateTempTableSqlPrefix
protected 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
-
getMaxFieldNameSize
public 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 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
-
getTempTableForTable
public DatabaseTable getTempTableForTable(DatabaseTable table)
Description copied from class:DatabasePlatformINTERNAL: May override this method if the platform support temporary tables.- Overrides:
getTempTableForTablein classDatabasePlatform- Parameters:
table- is original table for which temp table is created.- Returns:
- temporary table
-
isMaxDB
public boolean isMaxDB()
- Specified by:
isMaxDBin interfacePlatform- Overrides:
isMaxDBin classDatasourcePlatform
-
shouldAlwaysUseTempStorageForModifyAll
public 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 boolean shouldBindLiterals()
Description copied from class:DatabasePlatformPUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.- Overrides:
shouldBindLiteralsin classDatabasePlatform
-
shouldPrintOuterJoinInWhereClause
public 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 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
-
supportsStoredFunctions
public boolean supportsStoredFunctions()
- Overrides:
supportsStoredFunctionsin classDatabasePlatform
-
canBatchWriteWithOptimisticLocking
public boolean canBatchWriteWithOptimisticLocking(DatabaseCall call)
Description copied from class:DatabasePlatformINTERNAL: Supports Batch Writing with Optimistic Locking.- Overrides:
canBatchWriteWithOptimisticLockingin classDatabasePlatform
-
-