All Implemented Interfaces:
Serializable, Cloneable, CorePlatform<ConversionManager>, Platform
Direct Known Subclasses:
Informix11Platform

public class InformixPlatform extends DatabasePlatform

Purpose: Provides Informix specific behavior.

Responsibilities:

  • Types for schema creation.
  • Native sequencing using @@SERIAL.
Since:
TOPLink/Java 1.0.1
See Also:
  • Constructor Details

    • InformixPlatform

      public InformixPlatform()
      Default constructor.
  • Method Details

    • initializeConnectionData

      public void initializeConnectionData(Connection connection) throws SQLException
      Description copied from class: DatabasePlatform
      INTERNAL: Allow initialization from the connection.
      Overrides:
      initializeConnectionData in class DatabasePlatform
      Throws:
      SQLException
    • appendDate

      protected void appendDate(Date date, Writer writer) throws IOException
      Answer a platform correct string representation of a Date, suitable for SQL generation. Native format: 'yyyy-mm-dd
      Overrides:
      appendDate in class DatabasePlatform
      Throws:
      IOException
    • appendInformixTimestamp

      protected void appendInformixTimestamp(Timestamp timestamp, Writer writer) throws IOException
      Write a timestamp in Informix specific format (yyyy-mm-dd hh:mm:ss.fff).
      Throws:
      IOException
    • appendCalendar

      protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
      Answer a platform correct string representation of a Calendar, suitable for SQL generation. The date is printed in the ODBC platform independent format {d'YYYY-MM-DD'}.
      Overrides:
      appendCalendar in class DatabasePlatform
      Throws:
      IOException
    • appendInformixCalendar

      protected void appendInformixCalendar(Calendar calendar, Writer writer) throws IOException
      Write a timestamp in Informix specific format ( yyyy-mm-dd hh:mm:ss.fff)
      Throws:
      IOException
    • appendTime

      protected void appendTime(Time time, Writer writer) throws IOException
      Answer 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:
      appendTime in class DatabasePlatform
      Throws:
      IOException
    • appendTimestamp

      protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
      Answer a platform correct string representation of a Timestamp, suitable for SQL generation. The date is printed in the ODBC platform independent format {d'YYYY-MM-DD'}.
      Overrides:
      appendTimestamp in class DatabasePlatform
      Throws:
      IOException
    • buildFieldTypes

      protected Hashtable<Class<?>,FieldTypeDefinition> buildFieldTypes()
      Description copied from class: DatabasePlatform
      Return the mapping of class types to database types for the schema framework.
      Overrides:
      buildFieldTypes in class DatabasePlatform
    • buildSelectQueryForIdentity

      public ValueReadQuery buildSelectQueryForIdentity()
      INTERNAL: Build the identity query for native sequencing.
      Overrides:
      buildSelectQueryForIdentity in class DatasourcePlatform
    • getMaxFieldNameSize

      public int getMaxFieldNameSize()
      INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.
      Overrides:
      getMaxFieldNameSize in class DatabasePlatform
    • getSelectForUpdateString

      public String getSelectForUpdateString()
      Informix seems to like this syntax instead of the OF * syntax.
      Overrides:
      getSelectForUpdateString in class DatabasePlatform
    • isInformix

      public boolean isInformix()
      Specified by:
      isInformix in interface Platform
      Overrides:
      isInformix in class DatasourcePlatform
    • isInformixOuterJoin

      public boolean isInformixOuterJoin()
      Some database require outer joins to be given in the where clause, others require it in the from clause. Informix requires it in the from clause with no ON expression.
      Overrides:
      isInformixOuterJoin in class DatabasePlatform
    • shouldSelectIncludeOrderBy

      public boolean shouldSelectIncludeOrderBy()
      Informix seemed to require this at some point. Not sure if it still does.
      Overrides:
      shouldSelectIncludeOrderBy in class DatasourcePlatform
    • maximumNumericValues

      public Hashtable<Class<? extends Number>,? super Number> maximumNumericValues()
      Builds a table of maximum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.

      NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale

      Overrides:
      maximumNumericValues in class DatabasePlatform
    • minimumNumericValues

      public Hashtable<Class<? extends Number>,? super Number> minimumNumericValues()
      Builds a table of minimum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.

      NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale

      Overrides:
      minimumNumericValues in class DatabasePlatform
    • printFieldTypeSize

      public void printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause) throws IOException
      Append the field type to a writer unless the field uses an Identity strategy to generate its value. In this case, the field type 'SERIAL' will be appended later.
      Overrides:
      printFieldTypeSize in class DatabasePlatform
      Throws:
      IOException
    • printFieldIdentityClause

      public void printFieldIdentityClause(Writer writer) throws ValidationException
      Append the receiver's field serial constraint clause to a writer.
      Overrides:
      printFieldIdentityClause in class DatabasePlatform
      Throws:
      ValidationException
    • requiresProcedureCallBrackets

      public boolean requiresProcedureCallBrackets()
      Used for sp calls.
      Overrides:
      requiresProcedureCallBrackets in class DatabasePlatform
    • shouldPrintConstraintNameAfter

      public boolean shouldPrintConstraintNameAfter()
      Some Platforms want the constraint name after the constraint definition.
      Overrides:
      shouldPrintConstraintNameAfter in class DatabasePlatform
    • supportsIdentity

      public boolean supportsIdentity()
      INTERNAL: Indicates whether the platform supports identity. Informix does this through SERIAL field types. This method is to be used *ONLY* by sequencing classes
      Overrides:
      supportsIdentity in class DatasourcePlatform
    • supportsSequenceObjects

      public boolean supportsSequenceObjects()
      INTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes
      Overrides:
      supportsSequenceObjects in class DatasourcePlatform
    • buildSelectQueryForSequenceObject

      public ValueReadQuery buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)
      INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). This method is called when sequence object NativeSequence is connected, the returned query used until the sequence is disconnected. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.
      Overrides:
      buildSelectQueryForSequenceObject in class DatasourcePlatform
    • isAlterSequenceObjectSupported

      public boolean isAlterSequenceObjectSupported()
      INTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.
      Overrides:
      isAlterSequenceObjectSupported in class DatabasePlatform
    • initializePlatformOperators

      protected void initializePlatformOperators()
      INTERNAL: Initialize any platform-specific operators
      Overrides:
      initializePlatformOperators in class DatasourcePlatform