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

public Class DerbyPlatform

extends DB2Platform
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.database.JavaDBPlatform
Imports
java.io.IOException, .Writer, java.sql.CallableStatement, .Connection, .PreparedStatement, .SQLException, java.time.LocalTime, java.util.ArrayList, .Collection, .Hashtable, .Iterator, .List, .Vector, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.expressions.Expression, .ExpressionOperator, org.eclipse.persistence.internal.expressions.ExtractOperator, .CollectionExpression, .ConstantExpression, .ExpressionJavaPrinter, .ExpressionSQLPrinter, .ParameterExpression, .SQLSelectStatement, org.eclipse.persistence.internal.databaseaccess.DatabaseCall, .FieldTypeDefinition, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, .DatabaseTable, .Helper, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.queries.Call, .ValueReadQuery

Purpose: Provides Derby DBMS specific behavior.

Since
TOPLink Essentials 1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected boolean
pack-priv boolean
isOffsetFetchParameterSupported

< = 10.6.1.0 supports parameters with OFFSET/FETCH - DERBY-4208

protected boolean
isSequenceSupported

Allow sequence support to be disabled for Derby < 10.6.1.

public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ExpressionOperator
addOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '+' to be ?
protected void
appendByteArray(byte[] bytes, Writer writer)

Overrides org.eclipse.persistence.platform.database.DB2Platform.appendByteArray.

INTERNAL: TODO: Need to find out how can byte arrays be inlined in Derby
public int
appendParameterInternal(Call call, Writer writer, Object parameter)

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

Returns the number of parameters that used binding.
protected ExpressionOperator
avgOperator()

Disable binding support.

protected ExpressionOperator
betweenOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of 'BETWEEN' to be ?
protected Hashtable<Class<?>, FieldTypeDefinition>
buildFieldTypes()

Overrides org.eclipse.persistence.platform.database.DB2Platform.buildFieldTypes.

Return the mapping of class types to database types for the schema framework.
public ValueReadQuery
buildSelectQueryForIdentity()

Overrides org.eclipse.persistence.platform.database.DB2Platform.buildSelectQueryForIdentity.

INTERNAL: Build the identity query for native sequencing.
public Writer
public int
computeMaxRowsForSQL(int firstResultIndex, int maxResults)

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

INTERNAL: Use the JDBC maxResults and firstResultIndex setting to compute a value to use when limiting the results of a query in SQL.
protected ExpressionOperator
concatOperator()

Overrides org.eclipse.persistence.platform.database.DB2Platform.concatOperator.

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '||' to be ?
public Object
convertToDatabaseType(Object value)

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

Derby error the data type, length or value of arguments 'TIMESTAMP' and 'DATE' is incompatible.
private static ExpressionOperator
private static ExpressionOperator
protected ExpressionOperator
divideOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '/' to be ?
protected ExpressionOperator
equalOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '=' to be ?
protected String
protected String
public String
getInOutputProcedureToken()

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

This method is used to print the output parameter token when stored procedures are called
public Vector<E>
public String
public String
public String
public ValueReadQuery
getTimestampQuery()

Overrides org.eclipse.persistence.platform.database.DB2Platform.getTimestampQuery.

Implements org.eclipse.persistence.internal.databaseaccess.Platform.getTimestampQuery.

INTERNAL: This method returns the query to select the timestamp from the server for Derby.
protected ExpressionOperator
greaterThanEqualOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '>=' to be ?
protected ExpressionOperator
greaterThanOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '>' to be ?
public void
protected void
protected ExpressionOperator
inOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of 'IN' to be ?
public boolean
public boolean
public boolean
public boolean
isDynamicSQLRequiredForFunctions()

Overrides org.eclipse.persistence.platform.database.DB2Platform.isDynamicSQLRequiredForFunctions.

INTERNAL Derby has some issues with using parameters on certain functions and relations.
protected ExpressionOperator
lessThanEqualOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '<=' to be ?
protected ExpressionOperator
lessThanOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '<' to be ?
protected ExpressionOperator
ltrim2Operator()

Overrides org.eclipse.persistence.platform.database.DB2Platform.ltrim2Operator.

Enable binding since DB2 disables it

With binding enabled, Derby does not throw an exception

protected ExpressionOperator
modOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of 'mod' to be ?
protected ExpressionOperator
multiplyOperator()

Set binding support to PARTIAL.

protected ExpressionOperator
notBetweenOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of 'BETWEEN' to be ?
protected ExpressionOperator
notEqualOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '<>' to be ?
public void
printFieldIdentityClause(Writer writer)

Overrides org.eclipse.persistence.platform.database.DB2Platform.printFieldIdentityClause.

INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.
public void
printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)

Overrides org.eclipse.persistence.platform.database.DB2Platform.printSQLSelectStatement.

INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.
protected ExpressionOperator
roundOperator()

Overrides org.eclipse.persistence.platform.database.DB2Platform.roundOperator.

Emulate ROUND as FLOOR((:x)*1e:n+0.5)/1e:n
protected ExpressionOperator
rtrim2Operator()

Overrides org.eclipse.persistence.platform.database.DB2Platform.rtrim2Operator.

Enable binding since DB2 disables it

With binding enabled, Derby does not throw an exception

protected void
public void
setParameterValueInDatabaseCall(Object parameter, PreparedStatement statement, int index, AbstractSession session)

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

INTERNAL Set the parameter in the JDBC statement at the given index.
public void
setParameterValueInDatabaseCall(Object parameter, CallableStatement statement, String name, AbstractSession session)

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

INTERNAL Set the parameter in the JDBC statement with the given name.
public boolean
public boolean
shouldPrintOutputTokenAtStart()

Overrides org.eclipse.persistence.platform.database.DB2Platform.shouldPrintOutputTokenAtStart.

This is required in the construction of the stored procedures with output parameters
protected boolean
shouldTempTableSpecifyPrimaryKeys()

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

INTERNAL: Indicates whether temporary table can specify primary keys (some platforms don't allow that).
protected ExpressionOperator
subtractOperator()

Derby requires that at least one argument be a known type

With binding enabled, Derby will throw an error:

ERROR 42X35: It is not allowed for both operands of '-' to be ?
protected ExpressionOperator
sumOperator()

Disable binding support.

public boolean
supportsSequenceObjects()

Overrides org.eclipse.persistence.platform.database.DB2Platform.supportsSequenceObjects.

INTERNAL: Derby supports sequence objects as of 10.6.1.
protected ExpressionOperator
trim2()

Overrides org.eclipse.persistence.platform.database.DB2Platform.trim2.

Enable binding since DB2 disables it

With binding enabled, Derby does not throw an exception

public void
writeUpdateOriginalFromTempTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
,
Collection<DatabaseField>
- primary key fields for the original table.
pkFields
,
Collection<DatabaseField>
- fields to be assigned a new value.
assignedFields
)

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

INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work.
Inherited from org.eclipse.persistence.platform.database.DB2Platform:
allowBindingForSelectClauseappendCalendarappendDateappendDB2CalendarappendDB2DateappendDB2TimestampappendTimeappendTimestampascendingOperatorbuildSelectQueryForSequenceObjectcaseConditionOperatorcaseOperatorcoalesceOperatorcountdescendingOperatordisableAllBindingExpressiondisableAtLeast1BindingExpressiondistinctdontBindUpdateAllQueryUsingTempTablesgetCreateTempTableSqlPrefixgetMaxFieldNameSizegetMaxForeignKeyNameSizegetMaxUniqueKeyNameSizegetNoWaitStringgetProcedureArgumentgetProcedureAsStringgetProcedureCallHeadergetTempTableForTableisNullAllowedInSelectClauselengthOperatormaxmaximumNumericValuesminminimumNumericValuesnullifOperatorprintFieldTypeSizeshouldBindPartialParametersshouldPrintForUpdateClauseshouldUseJDBCOuterJoinSyntaxsupportsGlobalTempTablessupportsIdentitysupportsLockingQueriesWithMultipleTablessupportsOrderByParameterswriteParameterMarker