Class DerbyPlatform
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
- org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
- org.eclipse.persistence.platform.database.DatabasePlatform
-
- org.eclipse.persistence.platform.database.DB2Platform
-
- org.eclipse.persistence.platform.database.DerbyPlatform
-
- 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
- Direct Known Subclasses:
JavaDBPlatform
public class DerbyPlatform extends DB2Platform
Purpose: Provides Derby DBMS specific behavior.
- See Also:
- Serialized Form
- Since:
- TOPLink Essentials 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isConnectionDataInitialized
protected boolean
isSequenceSupported
Allow sequence support to be disabled for Derby < 10.6.1.static int
MAX_BLOB
static int
MAX_CLOB
-
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, 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 DerbyPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExpressionOperator
addOperator()
Derby requires that at least one argument be a known typeprotected void
appendByteArray(byte[] bytes, java.io.Writer writer)
INTERNAL: TODO: Need to find out how can byte arrays be inlined in Derbyint
appendParameterInternal(Call call, java.io.Writer writer, java.lang.Object parameter)
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 typeprotected java.util.Hashtable
buildFieldTypes()
ValueReadQuery
buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.java.io.Writer
buildSequenceObjectDeletionWriter(java.io.Writer writer, java.lang.String fullSeqName)
INTERNAL: Derby supports sequence objects as of 10.6.1.int
computeMaxRowsForSQL(int firstResultIndex, int maxResults)
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()
Derby requires that at least one argument be a known typejava.lang.Object
convertToDatabaseType(java.lang.Object value)
Derby error the data type, length or value of arguments 'TIMESTAMP' and 'DATE' is incompatible.protected ExpressionOperator
divideOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
equalOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
extractOperator()
INTERNAL: Derby does not support EXTRACT, but does have YEAR, MONTH, DAY, etc.protected java.lang.String
getCreateTempTableSqlBodyForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:protected java.lang.String
getCreateTempTableSqlSuffix()
INTERNAL:java.lang.String
getInOutputProcedureToken()
This method is used to print the output parameter token when stored procedures are calledjava.util.Vector
getNativeTableInfo(java.lang.String table, java.lang.String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Not currently used.java.lang.String
getProcedureBeginString()
Used for stored procedure defs.java.lang.String
getProcedureEndString()
Used for stored procedure defs.java.lang.String
getSelectForUpdateString()
INTERNAL: Used for pessimistic locking in DB2.ValueReadQuery
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 typeprotected ExpressionOperator
greaterThanOperator()
Derby requires that at least one argument be a known typevoid
initializeConnectionData(java.sql.Connection connection)
INTERNAL:protected void
initializePlatformOperators()
Initialize any platform-specific operatorsprotected ExpressionOperator
inOperator()
Derby requires that at least one argument be a known typeboolean
isAlterSequenceObjectSupported()
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.boolean
isDB2()
boolean
isDerby()
INTERNAL: Answers whether platform is Derbyboolean
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 typeprotected ExpressionOperator
lessThanOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
ltrim2Operator()
Enable binding support.protected ExpressionOperator
modOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
multiplyOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
notBetweenOperator()
Derby requires that at least one argument be a known typeprotected ExpressionOperator
notEqualOperator()
Derby requires that at least one argument be a known typevoid
printFieldIdentityClause(java.io.Writer writer)
INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.void
printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer, org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.protected ExpressionOperator
rtrim2Operator()
Enable binding support.protected void
setNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField, java.sql.PreparedStatement statement, int index)
void
setParameterValueInDatabaseCall(java.lang.Object parameter, java.sql.CallableStatement statement, java.lang.String name, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL Set the parameter in the JDBC statement with the given name.void
setParameterValueInDatabaseCall(java.lang.Object parameter, java.sql.PreparedStatement statement, int index, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL Set the parameter in the JDBC statement at the given index.boolean
shouldIgnoreException(java.sql.SQLException exception)
Allow for the platform to ignore exceptions.boolean
shouldPrintOutputTokenAtStart()
This is required in the construction of the stored procedures with output parametersprotected boolean
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 typeprotected ExpressionOperator
sumOperator()
Disable binding support.boolean
supportsSequenceObjects()
INTERNAL: Derby supports sequence objects as of 10.6.1.protected ExpressionOperator
trim2()
Enable binding support.void
writeUpdateOriginalFromTempTableSql(java.io.Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, java.util.Collection pkFields, java.util.Collection assignedFields)
INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work.-
Methods inherited from class org.eclipse.persistence.platform.database.DB2Platform
allowBindingForSelectClause, appendCalendar, appendDate, appendDB2Calendar, appendDB2Date, appendDB2Timestamp, appendTime, appendTimestamp, ascendingOperator, buildSelectQueryForSequenceObject, caseConditionOperator, caseOperator, coalesceOperator, count, descendingOperator, disableAllBindingExpression, disableAtLeast1BindingExpression, distinct, dontBindUpdateAllQueryUsingTempTables, getCreateTempTableSqlPrefix, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getProcedureArgument, getProcedureAsString, getProcedureCallHeader, getTempTableForTable, isNullAllowedInSelectClause, lengthOperator, max, maximumNumericValues, min, minimumNumericValues, nullifOperator, printFieldTypeSize, shouldBindPartialParameters, shouldPrintForUpdateClause, shouldUseJDBCOuterJoinSyntax, supportsGlobalTempTables, supportsIdentity, supportsLockingQueriesWithMultipleTables, supportsOrderByParameters, writeParameterMarker
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, checkTableExists, commitTransaction, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getIndexNamePrefix, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxIndexNameSize, getObjectFromResultSet, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgumentString, getProcedureCallTail, 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, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printFieldUnique, 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, 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, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsNestingOuterJoins, 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, writeTableCreationSuffix
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildNativeCall, 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, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2Z, isDBase, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, 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, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, toString, usesPlatformDefaultSequence
-
-
-
-
Field Detail
-
MAX_CLOB
public static final int MAX_CLOB
- See Also:
- Constant Field Values
-
MAX_BLOB
public static final int MAX_BLOB
- See Also:
- Constant Field Values
-
isSequenceSupported
protected boolean isSequenceSupported
Allow sequence support to be disabled for Derby < 10.6.1.
-
isConnectionDataInitialized
protected boolean isConnectionDataInitialized
-
-
Method Detail
-
appendByteArray
protected void appendByteArray(byte[] bytes, java.io.Writer writer) throws java.io.IOException
INTERNAL: TODO: Need to find out how can byte arrays be inlined in Derby- Overrides:
appendByteArray
in classDB2Platform
- Throws:
java.io.IOException
-
convertToDatabaseType
public java.lang.Object convertToDatabaseType(java.lang.Object value)
Derby error the data type, length or value of arguments 'TIMESTAMP' and 'DATE' is incompatible. Instead, use a java.sql.Date type for property {d } casting- Overrides:
convertToDatabaseType
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getTimestampQuery
public ValueReadQuery getTimestampQuery()
INTERNAL: This method returns the query to select the timestamp from the server for Derby.- Specified by:
getTimestampQuery
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
getTimestampQuery
in classDB2Platform
-
getNativeTableInfo
public java.util.Vector getNativeTableInfo(java.lang.String table, java.lang.String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Not currently used.- Overrides:
getNativeTableInfo
in classDB2Platform
-
getProcedureEndString
public java.lang.String getProcedureEndString()
Used for stored procedure defs.- Overrides:
getProcedureEndString
in classDB2Platform
-
getProcedureBeginString
public java.lang.String getProcedureBeginString()
Used for stored procedure defs.- Overrides:
getProcedureBeginString
in classDB2Platform
-
getInOutputProcedureToken
public java.lang.String getInOutputProcedureToken()
This method is used to print the output parameter token when stored procedures are called- Overrides:
getInOutputProcedureToken
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintOutputTokenAtStart
public boolean shouldPrintOutputTokenAtStart()
This is required in the construction of the stored procedures with output parameters- Overrides:
shouldPrintOutputTokenAtStart
in classDB2Platform
-
isDerby
public boolean isDerby()
INTERNAL: Answers whether platform is Derby- Specified by:
isDerby
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
isDerby
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
isDB2
public boolean isDB2()
- Specified by:
isDB2
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
isDB2
in classDB2Platform
-
getSelectForUpdateString
public java.lang.String getSelectForUpdateString()
Description copied from class:DB2Platform
INTERNAL: Used for pessimistic locking in DB2. Without the "WITH RS" the lock is not held.- Overrides:
getSelectForUpdateString
in classDB2Platform
-
shouldIgnoreException
public boolean shouldIgnoreException(java.sql.SQLException exception)
Allow for the platform to ignore exceptions.- Overrides:
shouldIgnoreException
in classDB2Platform
-
getCreateTempTableSqlSuffix
protected java.lang.String getCreateTempTableSqlSuffix()
INTERNAL:- Overrides:
getCreateTempTableSqlSuffix
in classDB2Platform
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.- Overrides:
buildSelectQueryForIdentity
in classDB2Platform
-
shouldTempTableSpecifyPrimaryKeys
protected boolean shouldTempTableSpecifyPrimaryKeys()
INTERNAL: Indicates whether temporary table can specify primary keys (some platforms don't allow that). Used by writeCreateTempTableSql method.- Overrides:
shouldTempTableSpecifyPrimaryKeys
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getCreateTempTableSqlBodyForTable
protected java.lang.String getCreateTempTableSqlBodyForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:- Overrides:
getCreateTempTableSqlBodyForTable
in classDB2Platform
-
writeUpdateOriginalFromTempTableSql
public void writeUpdateOriginalFromTempTableSql(java.io.Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, java.util.Collection pkFields, java.util.Collection assignedFields) throws java.io.IOException
INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work. Write an sql string for updating the original table from the temporary table. Precondition: supportsTempTables() == true. Precondition: pkFields and assignFields don't intersect.- Overrides:
writeUpdateOriginalFromTempTableSql
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Parameters:
writer
- for writing the sqltable
- is original table for which temp table is created.pkFields
- - primary key fields for the original table.assignedFields
- - fields to be assigned a new value.- Throws:
java.io.IOException
-
printFieldIdentityClause
public void printFieldIdentityClause(java.io.Writer writer) throws ValidationException
INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.- Overrides:
printFieldIdentityClause
in classDB2Platform
- Throws:
ValidationException
-
buildFieldTypes
protected java.util.Hashtable buildFieldTypes()
- Overrides:
buildFieldTypes
in classDB2Platform
-
setNullFromDatabaseField
protected void setNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField, java.sql.PreparedStatement statement, int index) throws java.sql.SQLException
- Overrides:
setNullFromDatabaseField
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
java.sql.SQLException
-
initializePlatformOperators
protected void initializePlatformOperators()
Initialize any platform-specific operators- Overrides:
initializePlatformOperators
in classDB2Platform
-
avgOperator
protected ExpressionOperator avgOperator()
Disable binding support.With binding enabled, Derby will throw an error:
ERROR 42X36: The 'AVG' operator is not allowed to take a ? parameter as an operand.
-
sumOperator
protected ExpressionOperator sumOperator()
Disable binding support.With binding enabled, Derby will throw an error:
ERROR 42X36: The 'SUM' operator is not allowed to take a ? parameter as an operand.
-
equalOperator
protected ExpressionOperator equalOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '=' to be ? parameters.
-
notEqualOperator
protected ExpressionOperator notEqualOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '<>' to be ? parameters.
-
greaterThanOperator
protected ExpressionOperator greaterThanOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '>' to be ? parameters.
-
greaterThanEqualOperator
protected ExpressionOperator greaterThanEqualOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '>=' to be ? parameters.
-
lessThanOperator
protected ExpressionOperator lessThanOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '<' to be ? parameters.
-
lessThanEqualOperator
protected ExpressionOperator lessThanEqualOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '<=' to be ? parameters.
-
extractOperator
protected ExpressionOperator extractOperator()
INTERNAL: Derby does not support EXTRACT, but does have YEAR, MONTH, DAY, etc.
-
addOperator
protected ExpressionOperator addOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '+' to be ? parameters.
-
subtractOperator
protected ExpressionOperator subtractOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '-' to be ? parameters.
-
multiplyOperator
protected ExpressionOperator multiplyOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '*' to be ? parameters.
-
divideOperator
protected ExpressionOperator divideOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '/' to be ? parameters.
-
concatOperator
protected ExpressionOperator concatOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of '||' to be ? parameters.
- Overrides:
concatOperator
in classDB2Platform
-
trim2
protected ExpressionOperator trim2()
Enable binding support.With binding enabled, Derby does not throw an exception
- Overrides:
trim2
in classDB2Platform
-
modOperator
protected ExpressionOperator modOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of 'mod' to be ? parameters.
-
ltrim2Operator
protected ExpressionOperator ltrim2Operator()
Enable binding support.With binding enabled, Derby does not throw an exception
- Overrides:
ltrim2Operator
in classDB2Platform
-
rtrim2Operator
protected ExpressionOperator rtrim2Operator()
Enable binding support.With binding enabled, Derby does not throw an exception
- Overrides:
rtrim2Operator
in classDB2Platform
-
betweenOperator
protected ExpressionOperator betweenOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of 'BETWEEN' to be ? parameters.
-
notBetweenOperator
protected ExpressionOperator notBetweenOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of 'BETWEEN' to be ? parameters.
-
inOperator
protected ExpressionOperator inOperator()
Derby requires that at least one argument be a known typeWith binding enabled, Derby will throw an error:
ERROR 42X35: It is not allowed for both operands of 'IN' to be ? parameters.
-
isDynamicSQLRequiredForFunctions
public boolean isDynamicSQLRequiredForFunctions()
INTERNAL Derby has some issues with using parameters on certain functions and relations. This allows statements to disable binding, for queries, only in these cases. If users set casting on, then casting is used instead of dynamic SQL.- Overrides:
isDynamicSQLRequiredForFunctions
in classDB2Platform
-
computeMaxRowsForSQL
public int computeMaxRowsForSQL(int firstResultIndex, int maxResults)
INTERNAL: Use the JDBC maxResults and firstResultIndex setting to compute a value to use when limiting the results of a query in SQL. These limits tend to be used in two ways. 1. MaxRows is the index of the last row to be returned (like JDBC maxResults) 2. MaxRows is the number of rows to be returned Derby uses case #2 and therefore the maxResults has to be altered based on the firstResultIndex.- Overrides:
computeMaxRowsForSQL
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
printSQLSelectStatement
public void printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call, org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer, org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall. Derby supports pagination through its "OFFSET n ROWS FETCH NEXT m ROWS" syntax.- Overrides:
printSQLSelectStatement
in classDB2Platform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
INTERNAL: Derby supports sequence objects as of 10.6.1.- Overrides:
supportsSequenceObjects
in classDB2Platform
-
isAlterSequenceObjectSupported
public boolean isAlterSequenceObjectSupported()
Description copied from class:DB2Platform
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.- Overrides:
isAlterSequenceObjectSupported
in classDB2Platform
-
buildSequenceObjectDeletionWriter
public java.io.Writer buildSequenceObjectDeletionWriter(java.io.Writer writer, java.lang.String fullSeqName) throws java.io.IOException
INTERNAL: Derby supports sequence objects as of 10.6.1.- Overrides:
buildSequenceObjectDeletionWriter
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
java.io.IOException
-
initializeConnectionData
public void initializeConnectionData(java.sql.Connection connection) throws java.sql.SQLException
INTERNAL:- Overrides:
initializeConnectionData
in classDB2Platform
- Throws:
java.sql.SQLException
-
setParameterValueInDatabaseCall
public void setParameterValueInDatabaseCall(java.lang.Object parameter, java.sql.PreparedStatement statement, int index, org.eclipse.persistence.internal.sessions.AbstractSession session) throws java.sql.SQLException
INTERNAL Set the parameter in the JDBC statement at the given index. This support a wide range of different parameter types, and is heavily optimized for common types.- Overrides:
setParameterValueInDatabaseCall
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
java.sql.SQLException
-
setParameterValueInDatabaseCall
public void setParameterValueInDatabaseCall(java.lang.Object parameter, java.sql.CallableStatement statement, java.lang.String name, org.eclipse.persistence.internal.sessions.AbstractSession session) throws java.sql.SQLException
INTERNAL Set the parameter in the JDBC statement with the given name. This support a wide range of different parameter types, and is heavily optimized for common types.- Overrides:
setParameterValueInDatabaseCall
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
java.sql.SQLException
-
appendParameterInternal
public int appendParameterInternal(Call call, java.io.Writer writer, java.lang.Object parameter)
Returns the number of parameters that used binding. Should only be called in case binding is not used.- Overrides:
appendParameterInternal
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
-