Top Description Fields Constructors Methods
org.eclipse.persistence.platform.database

public Class Informix11Platform

extends InformixPlatform
Class Inheritance
Imports
java.io.IOException, .Serializable, .Writer, java.sql.ResultSet, .SQLException, .Types, java.util.Collection, org.eclipse.persistence.expressions.ExpressionOperator, org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform, org.eclipse.persistence.internal.helper.DatabaseField, .DatabaseTable, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.queries.UpdateAllQuery

An InformixPlatform that fixes many EclipseLink bugs related to Informix support.
See Also
EclipseLink bug 401393, EclipseLink bug 401718, EclipseLink bug 401746, EclipseLink bug 402037, EclipseLink bug 402180, EclipseLink bug 402600, EclipseLink bug 402953, EclipseLink bug 405645

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

The version of this class for serialization purposes.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
appendBoolean(final Boolean
a non-null Boolean to append
booleanValue
,
final Writer
a non-null Writer to append the literal value to
writer
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.appendBoolean.

Fixes EclipseLink bug 401746 by writing out either 't' or 'f'—with single quotes— instead of 1 or 0.
protected ExpressionOperator
protected ExpressionOperator
protected ExpressionOperator
distinctOperator()

Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT  (no parentheses, one trailing space), and fixes

public boolean

Returns:

true when invoked
dontBindUpdateAllQueryUsingTempTables
()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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.
protected String
protected String

Returns:

WITH NO LOG when invoked
getCreateTempTableSqlSuffix
()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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.
public Object

Returns:

the Object resulting from a call to ResultSet#getObject(int); may be null
getObjectFromResultSet
(final ResultSet
the ResultSet to get an Object from; may be null
resultSet
,
final int
the 1-based column number indicating the column to use
columnNumber
,
final int
an int indicating the JDBC type of which the column in the ResultSet indicated by the supplied columnNumber is expected to be
jdbcType
,
final AbstractSession
an AbstractSession that, when used at all, is passed to the superclass implementation of this method; may be null
session
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getObjectFromResultSet.

Overrides org.eclipse.persistence.internal.databaseaccess.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.
public DatabaseTable

Returns:

a new DatabaseTable with no table qualifier
getTempTableForTable
(final DatabaseTable
the DatabaseTable for which a temporary DatabaseTable should be returned; must not be null
table
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getTempTableForTable.

Overrides the superclass implementation to return a new DatabaseTable with no DatabaseTable#getTableQualifier().
protected void
public boolean

Returns:

false when invoked
isInformixOuterJoin
()

Overrides org.eclipse.persistence.platform.database.InformixPlatform.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.
public boolean

Returns:

true in all cases
shouldAlwaysUseTempStorageForModifyAll
()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldAlwaysUseTempStorageForModifyAll.

Returns true when invoked to force Informix to use temporary storage when constructing bulk UPDATE statements.
public boolean

Returns:

true when invoked
supportsLocalTempTables
()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsLocalTempTables.

Returns true when invoked to indicate that Informix does indeed support local temporary tables.
public void
writeUpdateOriginalFromTempTableSql(final Writer
the Writer that will be writing SQL; must not be null
writer
,
final DatabaseTable
the DatabaseTable to be updated; must not be null
table
,
final Collection<DatabaseField>
a Collection of DatabaseFields each of which is a primary key of the table to be updated; must not be null
pkFields
,
final Collection<DatabaseField>
a Collection of DatabaseFields that are receiving updated values; must not be null
assignedFields
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.writeUpdateOriginalFromTempTableSql.

Overrides org.eclipse.persistence.internal.databaseaccess.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.
Inherited from org.eclipse.persistence.platform.database.InformixPlatform:
appendCalendarappendDateappendInformixCalendarappendInformixTimestampappendTimeappendTimestampbuildFieldTypesbuildSelectQueryForIdentitybuildSelectQueryForSequenceObjectgetMaxFieldNameSizegetSelectForUpdateStringinitializeConnectionDataisAlterSequenceObjectSupportedisInformixmaximumNumericValuesminimumNumericValuesprintFieldIdentityClauseprintFieldTypeSizerequiresProcedureCallBracketsshouldPrintConstraintNameAftershouldSelectIncludeOrderBysupportsIdentitysupportsSequenceObjects

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

The version of this class for serialization purposes.

See Also
Serializable

Constructor Detail

Informix11Platformback to summary
public Informix11Platform()

Creates a new Informix11Platform. Calls setShouldBindLiterals(boolean) with false as a parameter value.

See Also
EclipseLink bug 401718

Method Detail

appendBooleanback to summary
protected void appendBoolean(final Boolean booleanValue, final Writer writer) throws IOException

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.appendBoolean.

Fixes EclipseLink bug 401746 by writing out either 't' or 'f'—with single quotes— instead of 1 or 0.

Parameters
booleanValue:Boolean

a non-null Boolean to append

writer:Writer

a non-null Writer to append the literal value to

Annotations
@Override
Exceptions
IOException:
if the supplied Writer throws an IOException
IllegalArgumentException:
if either booleanValue or writer is null
See Also
EclipseLink bug 401393
currentDateOperatorback to summary
protected ExpressionOperator currentDateOperator()

Fixes EclipseLink bug 402953 by returning the result of running the following code: ExpressionOperator.simpleFunctionNoParentheses(ExpressionOperator.CurrentDate, "CURRENT YEAR TO DAY");

Returns:ExpressionOperator

a non-null ExpressionOperator

See Also
EclipseLink bug 402953
currentTimeOperatorback to summary
protected ExpressionOperator currentTimeOperator()

Fixes EclipseLink bug 402953 by returning the result of running the following code: ExpressionOperator.simpleFunctionNoParentheses(ExpressionOperator.CurrentDate, "CURRENT YEAR TO FRACTION(3)");

Returns:ExpressionOperator

a non-null ExpressionOperator EclipseLink bug 402953

distinctOperatorback to summary
protected ExpressionOperator distinctOperator()

Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT  (no parentheses, one trailing space), and fixes

See Also
EclipseLink bug 402600
dontBindUpdateAllQueryUsingTempTablesback to summary
public boolean dontBindUpdateAllQueryUsingTempTables()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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."

Returns:boolean

true when invoked

Annotations
@Override
See Also
EclipseLink bug 402037
getCreateTempTableSqlPrefixback to summary
protected String getCreateTempTableSqlPrefix()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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.

Returns:String

CREATE TEMP TABLE when invoked

Annotations
@Override
See Also
EclipseLink bug 402037
getCreateTempTableSqlSuffixback to summary
protected String getCreateTempTableSqlSuffix()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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.

Returns:String

WITH NO LOG when invoked

Annotations
@Override
See Also
EclipseLink bug 402037
getObjectFromResultSetback to summary
public Object getObjectFromResultSet(final ResultSet resultSet, final int columnNumber, final int jdbcType, final AbstractSession session) throws SQLException

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getObjectFromResultSet.

Overrides org.eclipse.persistence.internal.databaseaccess.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.

Parameters
resultSet:ResultSet

the ResultSet to get an Object from; may be null

columnNumber:int

the 1-based column number indicating the column to use

jdbcType:int

an int indicating the JDBC type of which the column in the ResultSet indicated by the supplied columnNumber is expected to be

session:AbstractSession

an AbstractSession that, when used at all, is passed to the superclass implementation of this method; may be null

Returns:Object

the Object resulting from a call to ResultSet#getObject(int); may be null

Annotations
@Override
Exceptions
SQLException:
if any error occurs
See Also
EclipseLink bug 405645
getTempTableForTableback to summary
public DatabaseTable getTempTableForTable(final DatabaseTable table)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getTempTableForTable.

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.

Parameters
table:DatabaseTable

the DatabaseTable for which a temporary DatabaseTable should be returned; must not be null

Returns:DatabaseTable

a new DatabaseTable with no table qualifier

Annotations
@Override
Exceptions
IllegalArgumentException:
if table is null
See Also
EclipseLink bug 402037, EclipseLink bug 402180
initializePlatformOperatorsback to summary
protected void initializePlatformOperators()

Overrides org.eclipse.persistence.platform.database.InformixPlatform.initializePlatformOperators.

Fixes EclipseLink bug 402600 by making sure that the Distinct ExpressionOperator is set to print as DISTINCT  (no parentheses, one trailing space), and fixes EclipseLink bug 402953 by adding platform operators for current date and current time.

Annotations
@Override
See Also
currentDateOperator(), currentTimeOperator(), EclipseLink bug 402600, EclipseLink bug 402953
isInformixOuterJoinback to summary
public boolean isInformixOuterJoin()

Overrides org.eclipse.persistence.platform.database.InformixPlatform.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.

Returns:boolean

false when invoked

Annotations
@Override
See Also
EclipseLink bug 401393
shouldAlwaysUseTempStorageForModifyAllback to summary
public boolean shouldAlwaysUseTempStorageForModifyAll()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldAlwaysUseTempStorageForModifyAll.

Returns true when invoked to force Informix to use temporary storage when constructing bulk UPDATE statements.

Returns:boolean

true in all cases

Annotations
@Override
See Also
EclipseLink bug 402037
supportsLocalTempTablesback to summary
public boolean supportsLocalTempTables()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsLocalTempTables.

Returns true when invoked to indicate that Informix does indeed support local temporary tables.

local is defined by EclipseLink in org.eclipse.persistence.internal.databaseaccess.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.
Returns:boolean

true when invoked

Annotations
@Override
See Also
EclipseLink bug 402037
writeUpdateOriginalFromTempTableSqlback to summary
public void writeUpdateOriginalFromTempTableSql(final Writer writer, final DatabaseTable table, final Collection<DatabaseField> pkFields, final Collection<DatabaseField> assignedFields) throws IOException

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.writeUpdateOriginalFromTempTableSql.

Overrides org.eclipse.persistence.internal.databaseaccess.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.

Parameters
writer:Writer

the Writer that will be writing SQL; must not be null

table:DatabaseTable

the DatabaseTable to be updated; must not be null

pkFields:Collection<DatabaseField>

a Collection of DatabaseFields each of which is a primary key of the table to be updated; must not be null

assignedFields:Collection<DatabaseField>

a Collection of DatabaseFields that are receiving updated values; must not be null

Annotations
@Override
Exceptions
IOException:
if an input/output error is thrown by the supplied Writer
NullPointerException:
if any of the supplied parameters is null
See Also
EclipseLink bug 402037