Class Informix11Platform

java.lang.Object
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
All Implemented Interfaces:
Serializable, Cloneable, org.eclipse.persistence.internal.core.databaseaccess.CorePlatform<org.eclipse.persistence.internal.helper.ConversionManager>, org.eclipse.persistence.internal.databaseaccess.Platform

public class Informix11Platform extends InformixPlatform
An InformixPlatform that fixes many EclipseLink bugs related to Informix support.
See Also:
  • 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Informix11Platform.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    appendBoolean(Boolean booleanValue, Writer writer)
    Fixes EclipseLink bug 401746 by writing out either 't' or 'f'—with single quotes— instead of 1 or 0.
    Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT&nbsp; (no parentheses, one trailing space), and fixes
    boolean
    Returns true when invoked to indicate that parameter binding must not be used when working with temporary tables as part of an UPDATE query.
    protected String
    Returns CREATE TEMP TABLE when invoked, per the Informix 11.70 Information Center documentation.
    protected String
    Returns WITH NO LOG when invoked, per the Informix 11.70 Information Center documentation, since transactions are not needed on temp tables for the purposes for which EclipseLink uses them.
    getObjectFromResultSet(ResultSet resultSet, int columnNumber, int jdbcType, org.eclipse.persistence.internal.sessions.AbstractSession session)
    Overrides DatabasePlatform.getObjectFromResultSet(ResultSet, int, int, AbstractSession) so that if the supplied jdbcType is equal to Types.LONGVARCHAR, then the ResultSet.getString(int) method (instead of the ResultSet.getObject(int) method) is used to fetch the "raw" value of the column indicated by the supplied columnNumber from the supplied ResultSet.
    org.eclipse.persistence.internal.helper.DatabaseTable
    getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
    Overrides the superclass implementation to return a new DatabaseTable with no DatabaseTable.getTableQualifier().
    protected void
    Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT&nbsp; (no parentheses, one trailing space), and fixes EclipseLink bug 402953 by adding platform operators for current date and current time.
    boolean
    Overrides the default behavior to return false, indicating that ANSI OUTER JOIN syntax should be used, since all modern versions of Informix support it.
    boolean
    Returns true when invoked to force Informix to use temporary storage when constructing bulk UPDATE statements.
    boolean
    Returns true when invoked to indicate that Informix does indeed support local temporary tables.
    void
    writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields)
    Overrides DatabasePlatform.writeUpdateOriginalFromTempTableSql(Writer, DatabaseTable, Collection, Collection) to ensure that a SET clause that is supposed to set a value for only one column does not wrap that column name in parentheses.

    Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

    addBatch, addStructConverter, allowBindingForSelectClause, allowsSizeInProcedureArguments, appendByteArray, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, checkTableExists, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateTempTableSqlBodyForTable, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgument, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureCallHeader, getProcedureCallTail, getProcedureEndString, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printFieldUnique, printSQLSelectStatement, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, registerOutputParameter, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, 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, shouldBindLiterals, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseJDBCOuterJoinSyntax, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsIndividualTableLocking, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, 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

    Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

    addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, toString, usesPlatformDefaultSequence

    Methods inherited from class java.lang.Object

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

    • Informix11Platform

      public Informix11Platform()
      Creates a new Informix11Platform. Calls DatabasePlatform.setShouldBindLiterals(boolean) with false as a parameter value.
      See Also:
  • Method Details

    • initializePlatformOperators

      protected void initializePlatformOperators()
      Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT&nbsp; (no parentheses, one trailing space), and fixes EclipseLink bug 402953 by adding platform operators for current date and current time.
      Overrides:
      initializePlatformOperators in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      See Also:
    • currentDateOperator

      protected ExpressionOperator currentDateOperator()
      Returns:
      a non-null ExpressionOperator
      See Also:
    • currentTimeOperator

      protected ExpressionOperator currentTimeOperator()
      Returns:
      a non-null ExpressionOperator EclipseLink bug 402953
    • distinctOperator

      protected ExpressionOperator distinctOperator()
      Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT&nbsp; (no parentheses, one trailing space), and fixes
      See Also:
    • isInformixOuterJoin

      public boolean isInformixOuterJoin()
      Overrides the default behavior to return false, indicating that ANSI OUTER JOIN syntax should be used, since all modern versions of Informix support it.
      Overrides:
      isInformixOuterJoin in class InformixPlatform
      Returns:
      false when invoked
      See Also:
    • appendBoolean

      protected void appendBoolean(Boolean booleanValue, Writer writer) throws IOException
      Fixes EclipseLink bug 401746 by writing out either 't' or 'f'—with single quotes— instead of 1 or 0.
      Overrides:
      appendBoolean in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Parameters:
      booleanValue - a non-null Boolean to append
      writer - a non-null Writer to append the literal value to
      Throws:
      IllegalArgumentException - if either booleanValue or writer is null
      IOException - if the supplied Writer throws an IOException
      See Also:
    • dontBindUpdateAllQueryUsingTempTables

      public boolean dontBindUpdateAllQueryUsingTempTables()
      Returns true when invoked to indicate that parameter binding must not be used when working with temporary tables as part of an UPDATE query.

      Parsing the English is a little difficult in this method name. It means: "Do not bind parameters in queries that are part of an overall 'update all' operation where temporary tables are being used."

      Overrides:
      dontBindUpdateAllQueryUsingTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Returns:
      true when invoked
      See Also:
    • shouldAlwaysUseTempStorageForModifyAll

      public boolean shouldAlwaysUseTempStorageForModifyAll()
      Returns true when invoked to force Informix to use temporary storage when constructing bulk UPDATE statements.
      Overrides:
      shouldAlwaysUseTempStorageForModifyAll in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Returns:
      true in all cases
      See Also:
    • supportsLocalTempTables

      public boolean supportsLocalTempTables()
      Returns true when invoked to indicate that Informix does indeed support local temporary tables.

      local is defined by EclipseLink in DatabasePlatform to mean:

      "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.
      Overrides:
      supportsLocalTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Returns:
      true when invoked
      See Also:
    • getCreateTempTableSqlPrefix

      protected String getCreateTempTableSqlPrefix()
      Returns CREATE TEMP TABLE when invoked, per the Informix 11.70 Information Center documentation.

      While Informix 11.70 supports an additional IF NOT EXISTS clause, Informix 11.50 does not, so this method does not add the IF NOT EXISTS clause. In practice this should be fine as temporary tables are scoped to the Informix session, and EclipseLink takes care of cleaning up any temporary tables that it creates.

      Overrides:
      getCreateTempTableSqlPrefix in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Returns:
      CREATE TEMP TABLE when invoked
      See Also:
    • getTempTableForTable

      public org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
      Overrides the superclass implementation to return a new DatabaseTable with no DatabaseTable.getTableQualifier(). Informix 11.50 and above do not support table qualifiers of any kind on temporary tables.
      Overrides:
      getTempTableForTable in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Parameters:
      table - the DatabaseTable for which a temporary DatabaseTable should be returned; must not be null
      Returns:
      a new DatabaseTable with no table qualifier
      Throws:
      IllegalArgumentException - if table is null
      See Also:
    • getCreateTempTableSqlSuffix

      protected String getCreateTempTableSqlSuffix()
      Returns WITH NO LOG when invoked, per the Informix 11.70 Information Center documentation, since transactions are not needed on temp tables for the purposes for which EclipseLink uses them.
      Overrides:
      getCreateTempTableSqlSuffix in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Returns:
      WITH NO LOG when invoked
      See Also:
    • writeUpdateOriginalFromTempTableSql

      public void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
      Overrides DatabasePlatform.writeUpdateOriginalFromTempTableSql(Writer, DatabaseTable, Collection, Collection) to ensure that a SET clause that is supposed to set a value for only one column does not wrap that column name in parentheses.

      The code for this method is identical to that of the stock H2Platform, since the H2 database has the same requirement.

      Overrides:
      writeUpdateOriginalFromTempTableSql in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Parameters:
      writer - the Writer that will be writing SQL; must not be null
      table - the DatabaseTable to be updated; must not be null
      pkFields - a Collection of DatabaseFields each of which is a primary key of the table to be updated; must not be null
      assignedFields - a Collection of DatabaseFields that are receiving updated values; must not be null
      Throws:
      IOException - if an input/output error is thrown by the supplied Writer
      NullPointerException - if any of the supplied parameters is null
      See Also:
    • getObjectFromResultSet

      public Object getObjectFromResultSet(ResultSet resultSet, int columnNumber, int jdbcType, org.eclipse.persistence.internal.sessions.AbstractSession session) throws SQLException
      Overrides DatabasePlatform.getObjectFromResultSet(ResultSet, int, int, AbstractSession) so that if the supplied jdbcType is equal to Types.LONGVARCHAR, then the ResultSet.getString(int) method (instead of the ResultSet.getObject(int) method) is used to fetch the "raw" value of the column indicated by the supplied columnNumber from the supplied ResultSet.

      This works around an issue with the Informix JDBC driver, version 3.70.JC7 and earlier, where a TEXT column is reported to be mappable to the JDBC type of LONGVARCHAR, but the actual object returned by ResultSet.getObject(int) is a byte[] (instead of either a char[] or a String). Invoking ResultSet.getString(int) instead returns the desired result.

      Overrides:
      getObjectFromResultSet in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
      Parameters:
      resultSet - the ResultSet to get an Object from; may be null
      columnNumber - the 1-based column number indicating the column to use
      jdbcType - an int indicating the JDBC type of which the column in the ResultSet indicated by the supplied columnNumber is expected to be
      session - an AbstractSession that, when used at all, is passed to the superclass implementation of this method; may be null
      Returns:
      the Object resulting from a call to ResultSet.getObject(int); may be null
      Throws:
      SQLException - if any error occurs
      See Also: