org.eclipse.persistence.platform.database
Class DerbyPlatform

java.lang.Object
  extended by org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      extended by org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
          extended by org.eclipse.persistence.platform.database.DatabasePlatform
              extended by org.eclipse.persistence.platform.database.DB2Platform
                  extended by org.eclipse.persistence.platform.database.DerbyPlatform
All Implemented Interfaces:
Serializable, Cloneable, 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
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
DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, Types_NCLOB
 
Constructor Summary
DerbyPlatform()
           
 
Method Summary
 ValueReadQuery buildSelectQueryForIdentity()
          INTERNAL: Build the identity query for native sequencing.
 String getInOutputProcedureToken()
          This method is used to print the output parameter token when stored procedures are called
 Vector getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return the catalog information through using the native SQL catalog selects.
 String getProcedureBeginString()
          Used for stored procedure defs.
 String getProcedureEndString()
          Used for stored procedure defs.
 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.
 boolean isDB2()
           
 boolean isDerby()
          INTERNAL: Answers whether platform is Derby
 void printFieldIdentityClause(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: Derby does not support the DB2 syntax, so perform the default.
 boolean shouldIgnoreException(SQLException exception)
          Allow for the platform to ignore exceptions.
 boolean shouldPrintOutputTokenAtStart()
          This is required in the construction of the stored procedures with output parameters
 boolean supportsSequenceObjects()
          INTERNAL: Derby does not support sequence objects as DB2 does.
 void writeUpdateOriginalFromTempTableSql(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, isAlterSequenceObjectSupported, isDynamicSQLRequiredForFunctions, isNullAllowedInSelectClause, maximumNumericValues, minimumNumericValues, shouldUseJDBCOuterJoinSyntax, supportsGlobalTempTables, supportsIdentity, supportsLockingQueriesWithMultipleTables, writeParameterMarker
 
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildCallWithReturning, buildCreateIndex, buildDropIndex, buildProcedureCallString, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConstraintDeletionString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxBatchWritingSize, getMaxIndexNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTransactionIsolation, getTypeConverters, initialize, isCastRequired, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLockTimeoutException, isXDBDocument, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, rollbackTransaction, setCastSizeForVarcharParameter, setCursorCode, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPingSQL, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsForeignKeyConstraints, supportsIndividualTableLocking, supportsLocalTempTables, supportsNativeSequenceNumbers, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB
 
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addSequence, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDBase, isFirebird, isH2, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle9, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, toString, usesPlatformDefaultSequence
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
Constructor Detail

DerbyPlatform

public DerbyPlatform()
Method Detail

getTimestampQuery

public ValueReadQuery getTimestampQuery()
INTERNAL: This method returns the query to select the timestamp from the server for Derby.

Specified by:
getTimestampQuery in interface org.eclipse.persistence.internal.databaseaccess.Platform
Overrides:
getTimestampQuery in class DB2Platform

getNativeTableInfo

public Vector getNativeTableInfo(String table,
                                 String creator,
                                 org.eclipse.persistence.internal.sessions.AbstractSession session)
Description copied from class: DB2Platform
INTERNAL: Return the catalog information through using the native SQL catalog selects. This is required because many JDBC driver do not support meta-data. Wildcards can be passed as arguments. This is currently not used.

Overrides:
getNativeTableInfo in class DB2Platform

getProcedureEndString

public String getProcedureEndString()
Used for stored procedure defs.

Overrides:
getProcedureEndString in class DB2Platform

getProcedureBeginString

public String getProcedureBeginString()
Used for stored procedure defs.

Overrides:
getProcedureBeginString in class DB2Platform

getInOutputProcedureToken

public String getInOutputProcedureToken()
This method is used to print the output parameter token when stored procedures are called

Overrides:
getInOutputProcedureToken in class org.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 class DB2Platform

isDerby

public boolean isDerby()
INTERNAL: Answers whether platform is Derby

Specified by:
isDerby in interface org.eclipse.persistence.internal.databaseaccess.Platform
Overrides:
isDerby in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

isDB2

public boolean isDB2()
Specified by:
isDB2 in interface org.eclipse.persistence.internal.databaseaccess.Platform
Overrides:
isDB2 in class DB2Platform

getSelectForUpdateString

public 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 class DB2Platform

shouldIgnoreException

public boolean shouldIgnoreException(SQLException exception)
Allow for the platform to ignore exceptions.

Overrides:
shouldIgnoreException in class DB2Platform

buildSelectQueryForIdentity

public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.

Overrides:
buildSelectQueryForIdentity in class DB2Platform

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:
writeUpdateOriginalFromTempTableSql in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Throws:
IOException

printFieldIdentityClause

public void printFieldIdentityClause(Writer writer)
                              throws ValidationException
INTERNAL: Append the receiver's field 'identity' constraint clause to a writer.

Overrides:
printFieldIdentityClause in class DB2Platform
Throws:
ValidationException

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: Derby does not support the DB2 syntax, so perform the default.

Overrides:
printSQLSelectStatement in class DB2Platform

supportsSequenceObjects

public boolean supportsSequenceObjects()
INTERNAL: Derby does not support sequence objects as DB2 does.

Overrides:
supportsSequenceObjects in class DB2Platform