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:
Serializable,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.
- Since:
- TOPLink Essentials 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_BLOBstatic intMAX_CLOB-
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZE
-
-
Constructor Summary
Constructors Constructor Description DerbyPlatform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueReadQuerybuildSelectQueryForIdentity()INTERNAL: Build the identity query for native sequencing.WriterbuildSequenceObjectDeletionWriter(Writer writer, String fullSeqName)INTERNAL: Derby supports sequence objects as of 10.6.1.intcomputeMaxRowsForSQL(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.static ExpressionOperatorextractOperator()INTERNAL: Derby does not support EXTRACT, but does have YEAR, MONTH, DAY, etc.StringgetInOutputProcedureToken()This method is used to print the output parameter token when stored procedures are calledVectorgetNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Not currently used.StringgetProcedureBeginString()Used for stored procedure defs.StringgetProcedureEndString()Used for stored procedure defs.StringgetSelectForUpdateString()INTERNAL: Used for pessimistic locking in DB2.ValueReadQuerygetTimestampQuery()INTERNAL: This method returns the query to select the timestamp from the server for Derby.voidinitializeConnectionData(Connection connection)INTERNAL:booleanisAlterSequenceObjectSupported()INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.booleanisDB2()booleanisDerby()INTERNAL: Answers whether platform is DerbyvoidprintFieldIdentityClause(Writer writer)INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.voidprintSQLSelectStatement(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.booleanshouldIgnoreException(SQLException exception)Allow for the platform to ignore exceptions.booleanshouldPrintOutputTokenAtStart()This is required in the construction of the stored procedures with output parametersbooleansupportsSequenceObjects()INTERNAL: Derby supports sequence objects as of 10.6.1.voidwriteUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, 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
buildSelectQueryForSequenceObject, dontBindUpdateAllQueryUsingTempTables, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getProcedureAsString, getProcedureCallHeader, getTempTableForTable, isDynamicSQLRequiredForFunctions, isNullAllowedInSelectClause, maximumNumericValues, minimumNumericValues, shouldPrintForUpdateClause, shouldUseJDBCOuterJoinSyntax, supportsGlobalTempTables, supportsIdentity, supportsLockingQueriesWithMultipleTables, writeParameterMarker
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, 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, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, 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, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDriverName, setDriverSupportsNVarChar, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, 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, 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, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeTableCreationSuffix
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDBase, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, 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
-
-
Method Detail
-
getTimestampQuery
public ValueReadQuery getTimestampQuery()
INTERNAL: This method returns the query to select the timestamp from the server for Derby.- Specified by:
getTimestampQueryin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
getTimestampQueryin classDB2Platform
-
getNativeTableInfo
public Vector getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Not currently used.- Overrides:
getNativeTableInfoin classDB2Platform
-
getProcedureEndString
public String getProcedureEndString()
Used for stored procedure defs.- Overrides:
getProcedureEndStringin classDB2Platform
-
getProcedureBeginString
public String getProcedureBeginString()
Used for stored procedure defs.- Overrides:
getProcedureBeginStringin classDB2Platform
-
getInOutputProcedureToken
public String getInOutputProcedureToken()
This method is used to print the output parameter token when stored procedures are called- Overrides:
getInOutputProcedureTokenin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintOutputTokenAtStart
public boolean shouldPrintOutputTokenAtStart()
This is required in the construction of the stored procedures with output parameters- Overrides:
shouldPrintOutputTokenAtStartin classDB2Platform
-
isDerby
public boolean isDerby()
INTERNAL: Answers whether platform is Derby- Specified by:
isDerbyin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
isDerbyin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
isDB2
public boolean isDB2()
- Specified by:
isDB2in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
isDB2in classDB2Platform
-
getSelectForUpdateString
public String getSelectForUpdateString()
Description copied from class:DB2PlatformINTERNAL: Used for pessimistic locking in DB2. Without the "WITH RS" the lock is not held.- Overrides:
getSelectForUpdateStringin classDB2Platform
-
shouldIgnoreException
public boolean shouldIgnoreException(SQLException exception)
Allow for the platform to ignore exceptions.- Overrides:
shouldIgnoreExceptionin classDB2Platform
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.- Overrides:
buildSelectQueryForIdentityin classDB2Platform
-
writeUpdateOriginalFromTempTableSql
public void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields) throws 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:
writeUpdateOriginalFromTempTableSqlin 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:
IOException
-
printFieldIdentityClause
public void printFieldIdentityClause(Writer writer) throws ValidationException
INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.- Overrides:
printFieldIdentityClausein classDB2Platform- Throws:
ValidationException
-
extractOperator
public static ExpressionOperator extractOperator()
INTERNAL: Derby does not support EXTRACT, but does have YEAR, MONTH, DAY, etc.
-
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:
computeMaxRowsForSQLin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- See Also:
MySQLPlatform
-
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:
printSQLSelectStatementin classDB2Platform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
INTERNAL: Derby supports sequence objects as of 10.6.1.- Overrides:
supportsSequenceObjectsin classDB2Platform
-
isAlterSequenceObjectSupported
public boolean isAlterSequenceObjectSupported()
Description copied from class:DB2PlatformINTERNAL: DB2 added SEQUENCE support as of (I believe) v8.- Overrides:
isAlterSequenceObjectSupportedin classDB2Platform
-
buildSequenceObjectDeletionWriter
public Writer buildSequenceObjectDeletionWriter(Writer writer, String fullSeqName) throws IOException
INTERNAL: Derby supports sequence objects as of 10.6.1.- Overrides:
buildSequenceObjectDeletionWriterin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
IOException
-
initializeConnectionData
public void initializeConnectionData(Connection connection) throws SQLException
INTERNAL:- Overrides:
initializeConnectionDatain classDB2Platform- Throws:
SQLException
-
-