Class 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.

    Wiki page

    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)
    Limitations:
    • 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.

    See Also:
    Serialized Form
    Author:
    Markus KARG (markus at headcrashing.eu), afischbach, agoerler, Sabine Heider (sabine.heider at sap.com), Konstantin Schwed (konstantin.schwed at sap.com)
    • Field Summary

      • 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
      MaxDBPlatform()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Hashtable buildFieldTypes()  
      ValueReadQuery buildSelectQueryForSequenceObject​(java.lang.String sequenceName, java.lang.Integer size)  
      boolean canBatchWriteWithOptimisticLocking​(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call)  
      protected java.lang.String getCreateTempTableSqlPrefix()  
      int getMaxFieldNameSize()  
      java.lang.String getSelectForUpdateNoWaitString()  
      java.lang.String getSelectForUpdateString()  
      org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable​(org.eclipse.persistence.internal.helper.DatabaseTable table)  
      protected void initializePlatformOperators()  
      boolean isForUpdateCompatibleWithDistinct()  
      boolean isMaxDB()  
      protected void printFieldTypeSize​(java.io.Writer writer, FieldDefinition field, org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType)  
      boolean shouldAlwaysUseTempStorageForModifyAll()  
      boolean shouldBindLiterals()  
      boolean shouldOptimizeDataConversion()  
      boolean shouldPrintOuterJoinInWhereClause()  
      boolean shouldUseJDBCOuterJoinSyntax()  
      boolean supportsIndividualTableLocking()  
      boolean supportsLocalTempTables()  
      boolean supportsNativeSequenceNumbers()  
      boolean supportsSequenceObjects()  
      boolean supportsStoredFunctions()  
      • 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, getIdentifierQuoteCharacter, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, 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, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle23, 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MaxDBPlatform

        public MaxDBPlatform()
    • Method Detail

      • isForUpdateCompatibleWithDistinct

        public boolean isForUpdateCompatibleWithDistinct()
        Overrides:
        isForUpdateCompatibleWithDistinct in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • getSelectForUpdateString

        public java.lang.String getSelectForUpdateString()
        Overrides:
        getSelectForUpdateString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • getSelectForUpdateNoWaitString

        public java.lang.String getSelectForUpdateNoWaitString()
        Overrides:
        getSelectForUpdateNoWaitString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • buildFieldTypes

        protected final java.util.Hashtable buildFieldTypes()
        Overrides:
        buildFieldTypes in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • supportsIndividualTableLocking

        public boolean supportsIndividualTableLocking()
        Overrides:
        supportsIndividualTableLocking in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • printFieldTypeSize

        protected void printFieldTypeSize​(java.io.Writer writer,
                                          FieldDefinition field,
                                          org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType)
                                   throws java.io.IOException
        Overrides:
        printFieldTypeSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
        Throws:
        java.io.IOException
      • initializePlatformOperators

        protected final void initializePlatformOperators()
        Overrides:
        initializePlatformOperators in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      • shouldOptimizeDataConversion

        public boolean shouldOptimizeDataConversion()
        Overrides:
        shouldOptimizeDataConversion in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • supportsNativeSequenceNumbers

        public final boolean supportsNativeSequenceNumbers()
        Overrides:
        supportsNativeSequenceNumbers in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      • buildSelectQueryForSequenceObject

        public final ValueReadQuery buildSelectQueryForSequenceObject​(java.lang.String sequenceName,
                                                                      java.lang.Integer size)
        Overrides:
        buildSelectQueryForSequenceObject in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      • getCreateTempTableSqlPrefix

        protected final java.lang.String getCreateTempTableSqlPrefix()
        Overrides:
        getCreateTempTableSqlPrefix in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • getMaxFieldNameSize

        public final int getMaxFieldNameSize()
        Overrides:
        getMaxFieldNameSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • supportsLocalTempTables

        public final boolean supportsLocalTempTables()
        Overrides:
        supportsLocalTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • getTempTableForTable

        public final org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable​(org.eclipse.persistence.internal.helper.DatabaseTable table)
        Overrides:
        getTempTableForTable in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • isMaxDB

        public final boolean isMaxDB()
        Specified by:
        isMaxDB in interface org.eclipse.persistence.internal.databaseaccess.Platform
        Overrides:
        isMaxDB in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      • shouldAlwaysUseTempStorageForModifyAll

        public final boolean shouldAlwaysUseTempStorageForModifyAll()
        Overrides:
        shouldAlwaysUseTempStorageForModifyAll in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • shouldBindLiterals

        public final boolean shouldBindLiterals()
        Overrides:
        shouldBindLiterals in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • shouldPrintOuterJoinInWhereClause

        public final boolean shouldPrintOuterJoinInWhereClause()
        Overrides:
        shouldPrintOuterJoinInWhereClause in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • shouldUseJDBCOuterJoinSyntax

        public final boolean shouldUseJDBCOuterJoinSyntax()
        Overrides:
        shouldUseJDBCOuterJoinSyntax in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • supportsSequenceObjects

        public boolean supportsSequenceObjects()
        Overrides:
        supportsSequenceObjects in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      • supportsStoredFunctions

        public final boolean supportsStoredFunctions()
        Overrides:
        supportsStoredFunctions in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      • canBatchWriteWithOptimisticLocking

        public boolean canBatchWriteWithOptimisticLocking​(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call)
        Overrides:
        canBatchWriteWithOptimisticLocking in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform