Class OraclePlatform
- 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.OraclePlatform
-
- 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:
Oracle8Platform
public class OraclePlatform extends DatabasePlatform
Purpose: Provides Oracle specific behavior.
Responsibilities:
- Native SQL for byte[], Date, Time, & Timestamp.
- Native sequencing named sequences.
- Native SQL/ROWNUM support for MaxRows and FirstResult filtering.
- Since:
- TOPLink/Java 1.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZE
-
-
Constructor Summary
Constructors Constructor Description OraclePlatform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsSizeInProcedureArguments()
Used for stored procedure definitions.ExpressionOperator
atan2Operator()
INTERNAL: Build operator.org.eclipse.persistence.internal.databaseaccess.DatabaseCall
buildCallWithReturning(SQLCall sqlCall, Vector returnFields)
INTERNAL: Returns null unless the platform supports call with returningValueReadQuery
buildSelectQueryForIdentity(String qualifiedSeqName, Integer size)
INTERNAL: Though Oracle doesn't support identity it could be imitated, see comment to setSupportsIdentity method.ValueReadQuery
buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)
INTERNAL: Produce a DataReadQuery which updates(!) the sequence number in the db and returns it.boolean
canBuildCallWithReturning()
INTERNAL: Indicates whether the platform can build call with returning.boolean
canUnwrapOracleConnection()
INTERNAL: Indicates whether this Oracle platform can unwrap Oracle connection.void
clearOracleConnectionCache(Connection conn)
INTERNAL: Clears both implicit and explicit caches of OracleConnection on Oracle9Platform, noop here.static ExpressionOperator
exceptOperator()
INTERNAL: Create the EXCEPT operator, MINUS in Oracle.String
getAssignmentString()
INTERNAL: Used for stored function calls.String
getBatchBeginString()
Used for batch writing and sp defs.String
getBatchEndString()
Used for batch writing and sp defs.String
getBatchRowCountAssignString()
Used for batch writing for row count return.String
getBatchRowCountDeclareString()
Used for batch writing for row count return.String
getBatchRowCountReturnString()
Used for batch writing for row count return.String
getDeclareBeginString()
INTERNAL: DECLARE stanza header for Anonymous PL/SQL blockString
getDropCascadeString()
Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.String
getDropDatabaseSchemaString(String schema)
Return the drop schema definition.int
getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.Vector
getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
Return the catalog information through using the native SQL catalog selects.Object
getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Get a timestamp value from a result set.String
getProcedureArgumentSetter()
Used for sp calls.String
getProcedureCallHeader()
Used for sp calls.String
getProcedureCallTail()
Used for sp calls.String
getSelectForUpdateString()
Most database support a syntax.String
getSelectForUpdateWaitString(Integer waitTimeout)
Platforms that support the WAIT option should override this method.String
getStoredProcedureParameterPrefix()
ValueReadQuery
getSystemChangeNumberQuery()
PUBLIC: The query to select the current system change number from Oracle.ValueReadQuery
getTimestampQuery()
PUBLIC: This method returns the query to select the timestamp from the server for Oracle.DatabaseQuery
getVPDClearIdentifierQuery(String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD clear identifier query.String
getVPDCreationFunctionString(String tableName, String tenantFieldName)
INTERNAL: Return an Oracle defined VPD identifier function.String
getVPDCreationPolicyString(String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return an Oracle defined VPD identifier policy.String
getVPDDeletionString(String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return an Oracle defined VPD identifier policy deletion.DatabaseQuery
getVPDSetIdentifierQuery(String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD set identifier query.void
initializeConnectionData(Connection connection)
INTERNAL: Allow initialization from the connection.boolean
isAlterSequenceObjectSupported()
INTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.boolean
isForUpdateCompatibleWithDistinct()
INTERNAL: Indicates whether SELECT DISTINCT ...boolean
isLobCompatibleWithDistinct()
INTERNAL: Indicates whether SELECT DISTINCT lob FROM ...boolean
isLockTimeoutException(DatabaseException e)
Return true if the given exception occurred as a result of a lock time out exception (WAIT clause).boolean
isNativeConnectionRequiredForLobLocator()
INTERNAL: Used by derived platforms (Oracle8Platform and higher) to indicate whether app.boolean
isOracle()
boolean
isRowCountOutputParameterRequired()
Oracle does not return the row count from PLSQL anon blocks, so an output parameter is required for this.Hashtable
maximumNumericValues()
Builds a table of maximum numeric values keyed on java class.Hashtable
minimumNumericValues()
Builds a table of minimum numeric values keyed on java class.void
printFieldNullClause(Writer writer)
INTERNAL: Append the receiver's field 'NULL' 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.static ExpressionOperator
regexpOperator()
INTERNAL: Create the REGEXP_LIKE operator.String
serverTimestampString()
Return the current date and time from the server.void
setSupportsIdentity(boolean supportsIdentity)
ADVANCED: Oracle db doesn't support identity.boolean
shouldPrintForUpdateClause()
boolean
shouldPrintStoredProcedureArgumentNameInCall()
INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g.boolean
shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this.boolean
supportsAutoConversionToNumericForArithmeticOperations()
Some db allow VARCHAR db field to be used in arithmetic operations automatically converting them to numeric: UPDATE OL_PHONE SET PHONE_ORDER_VARCHAR = (PHONE_ORDER_VARCHAR + 1) WHERE ...boolean
supportsIdentity()
INTERNAL: Indicates whether the platform supports identity.boolean
supportsSelectForUpdateNoWait()
Returns true if the database supports SQL syntax not to wait on a SELECT..FOR UPADTE (i.e.boolean
supportsSequenceObjects()
INTERNAL: Indicates whether the platform supports sequence objects.boolean
supportsStoredFunctions()
INTERNAL: Return if database stored functions are supported.boolean
supportsVPD()
Oracle db supports VPD.Connection
unwrapOracleConnection(Connection connection)
INTERNAL: If can unwrap returns unwrapped Oracle connection, otherwise original connection.boolean
useJDBCStoredProcedureSyntax()
Return true if JDBC syntax should be used for stored procedure calls.boolean
wasFailureCommunicationBased(SQLException exception, Connection connection, org.eclipse.persistence.internal.sessions.AbstractSession sessionForProfile)
INTERNAL: A call to this method will perform a platform based check on the connection and exception error code to determine if the connection is still valid or if a communication error has occurred.-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getBatchDelimiterString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureEndString, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTempTableForTable, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, hasPartitioningCallback, initialize, isCastRequired, isDynamicSQLRequiredForFunctions, isInformixOuterJoin, isJDBCExecuteCompliant, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isXDBDocument, minimumTimeIncrement, prepareBatchStatement, printFieldIdentityClause, printFieldNotNullClause, 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, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarker, writeTableCreationSuffix, writeUpdateOriginalFromTempTableSql
-
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, isDB2, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, 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
-
-
-
-
Method Detail
-
initializeConnectionData
public void initializeConnectionData(Connection connection) throws SQLException
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: Allow initialization from the connection.- Overrides:
initializeConnectionData
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
SQLException
-
allowsSizeInProcedureArguments
public boolean allowsSizeInProcedureArguments()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure definitions.- Overrides:
allowsSizeInProcedureArguments
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
atan2Operator
public ExpressionOperator atan2Operator()
INTERNAL: Build operator.
-
buildCallWithReturning
public org.eclipse.persistence.internal.databaseaccess.DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields)
INTERNAL: Returns null unless the platform supports call with returning- Overrides:
buildCallWithReturning
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
canBuildCallWithReturning
public boolean canBuildCallWithReturning()
INTERNAL: Indicates whether the platform can build call with returning. In case this method returns true, buildCallWithReturning method may be called.- Overrides:
canBuildCallWithReturning
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
clearOracleConnectionCache
public void clearOracleConnectionCache(Connection conn)
INTERNAL: Clears both implicit and explicit caches of OracleConnection on Oracle9Platform, noop here.
-
getAssignmentString
public String getAssignmentString()
INTERNAL: Used for stored function calls.- Overrides:
getAssignmentString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDeclareBeginString
public String getDeclareBeginString()
INTERNAL: DECLARE stanza header for Anonymous PL/SQL block
-
getBatchBeginString
public String getBatchBeginString()
Used for batch writing and sp defs.- Overrides:
getBatchBeginString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchEndString
public String getBatchEndString()
Used for batch writing and sp defs.- Overrides:
getBatchEndString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountDeclareString
public String getBatchRowCountDeclareString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountDeclareString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isRowCountOutputParameterRequired
public boolean isRowCountOutputParameterRequired()
Oracle does not return the row count from PLSQL anon blocks, so an output parameter is required for this.- Overrides:
isRowCountOutputParameterRequired
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountReturnString
public String getBatchRowCountReturnString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountReturnString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDropDatabaseSchemaString
public String getDropDatabaseSchemaString(String schema)
Return the drop schema definition. Subclasses should override as needed.- Overrides:
getDropDatabaseSchemaString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountAssignString
public String getBatchRowCountAssignString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountAssignString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getMaxFieldNameSize
public int getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.- Overrides:
getMaxFieldNameSize
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getNativeTableInfo
public Vector getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
Return the catalog information through using the native SQL catalog selects. This is required because many JDBC driver do not support meta-data. Willcards can be passed as arguments.
-
getProcedureArgumentSetter
public String getProcedureArgumentSetter()
Used for sp calls.- Overrides:
getProcedureArgumentSetter
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getProcedureCallHeader
public String getProcedureCallHeader()
Used for sp calls.- Overrides:
getProcedureCallHeader
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getProcedureCallTail
public String getProcedureCallTail()
Used for sp calls.- Overrides:
getProcedureCallTail
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDropCascadeString
public String getDropCascadeString()
Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.- Overrides:
getDropCascadeString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateString
public String getSelectForUpdateString()
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Most database support a syntax. although don't actually lock the row. Some require the OF some don't like it.- Overrides:
getSelectForUpdateString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateWaitString
public String getSelectForUpdateWaitString(Integer waitTimeout)
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Platforms that support the WAIT option should override this method. By default the wait timeout is ignored.- Overrides:
getSelectForUpdateWaitString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getStoredProcedureParameterPrefix
public String getStoredProcedureParameterPrefix()
- Overrides:
getStoredProcedureParameterPrefix
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSystemChangeNumberQuery
public ValueReadQuery getSystemChangeNumberQuery()
PUBLIC: The query to select the current system change number from Oracle. In order to execute this query a database administrator may need to grant execute permission on pl/sql package DBMS_FLASHBACK.
-
getTimestampQuery
public ValueReadQuery getTimestampQuery()
PUBLIC: This method returns the query to select the timestamp from the server for Oracle.- Specified by:
getTimestampQuery
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
getTimestampQuery
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getVPDClearIdentifierQuery
public DatabaseQuery getVPDClearIdentifierQuery(String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD clear identifier query.- Overrides:
getVPDClearIdentifierQuery
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDCreationFunctionString
public String getVPDCreationFunctionString(String tableName, String tenantFieldName)
INTERNAL: Return an Oracle defined VPD identifier function. Used for DDL generation.- Overrides:
getVPDCreationFunctionString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDCreationPolicyString
public String getVPDCreationPolicyString(String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return an Oracle defined VPD identifier policy. Used for DDL generation.- Overrides:
getVPDCreationPolicyString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDDeletionString
public String getVPDDeletionString(String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return an Oracle defined VPD identifier policy deletion. Used for DDL generation.- Overrides:
getVPDDeletionString
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDSetIdentifierQuery
public DatabaseQuery getVPDSetIdentifierQuery(String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD set identifier query.- Overrides:
getVPDSetIdentifierQuery
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getObjectFromResultSet
public Object getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type, org.eclipse.persistence.internal.sessions.AbstractSession session) throws SQLException
INTERNAL: Get a timestamp value from a result set. Overrides the default behavior to specifically return a timestamp. Added to overcome an issue with the oracle 9.0.1.4 JDBC driver.- Overrides:
getObjectFromResultSet
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
SQLException
- See Also:
org.eclipse.persistence.oraclespecific.Oracle9Platform
-
exceptOperator
public static ExpressionOperator exceptOperator()
INTERNAL: Create the EXCEPT operator, MINUS in Oracle.
-
regexpOperator
public static ExpressionOperator regexpOperator()
INTERNAL: Create the REGEXP_LIKE operator.
-
isNativeConnectionRequiredForLobLocator
public boolean isNativeConnectionRequiredForLobLocator()
INTERNAL: Used by derived platforms (Oracle8Platform and higher) to indicate whether app. server should unwrap connection to use lob locator.
-
isOracle
public boolean isOracle()
- Specified by:
isOracle
in interfaceorg.eclipse.persistence.internal.databaseaccess.Platform
- Overrides:
isOracle
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
maximumNumericValues
public Hashtable maximumNumericValues()
Builds a table of maximum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
- Overrides:
maximumNumericValues
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
minimumNumericValues
public Hashtable minimumNumericValues()
Builds a table of minimum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
- Overrides:
minimumNumericValues
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
buildSelectQueryForSequenceObject
public ValueReadQuery buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)
INTERNAL: Produce a DataReadQuery which updates(!) the sequence number in the db and returns it. Currently implemented on Oracle only.- Overrides:
buildSelectQueryForSequenceObject
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
- Parameters:
qualifiedSeqName
- known by Oracle to be a defined sequence
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity(String qualifiedSeqName, Integer size)
INTERNAL: Though Oracle doesn't support identity it could be imitated, see comment to setSupportsIdentity method.- Overrides:
buildSelectQueryForIdentity
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
- Parameters:
qualifiedSeqName
- known by Oracle to be a defined sequence
-
printFieldNullClause
public void printFieldNullClause(Writer writer) throws ValidationException
INTERNAL: Append the receiver's field 'NULL' constraint clause to a writer.- Overrides:
printFieldNullClause
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
- Throws:
ValidationException
-
serverTimestampString
public String serverTimestampString()
Return the current date and time from the server.
-
shouldPrintStoredProcedureArgumentNameInCall
public boolean shouldPrintStoredProcedureArgumentNameInCall()
INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g. EXECUTE PROCEDURE MyStoredProc(myvariable = ?)- Overrides:
shouldPrintStoredProcedureArgumentNameInCall
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldUseJDBCOuterJoinSyntax
public boolean shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.- Overrides:
shouldUseJDBCOuterJoinSyntax
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsAutoConversionToNumericForArithmeticOperations
public boolean supportsAutoConversionToNumericForArithmeticOperations()
Some db allow VARCHAR db field to be used in arithmetic operations automatically converting them to numeric: UPDATE OL_PHONE SET PHONE_ORDER_VARCHAR = (PHONE_ORDER_VARCHAR + 1) WHERE ... SELECT ... WHERE ... t0.MANAGED_ORDER_VARCHAR BETWEEN 1 AND 4 ...- Overrides:
supportsAutoConversionToNumericForArithmeticOperations
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
INTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes- Overrides:
supportsSequenceObjects
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
supportsIdentity
public boolean supportsIdentity()
INTERNAL: Indicates whether the platform supports identity. This method is to be used *ONLY* by sequencing classes- Overrides:
supportsIdentity
in classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
setSupportsIdentity
public void setSupportsIdentity(boolean supportsIdentity)
ADVANCED: Oracle db doesn't support identity. However it's possible to get identity-like behavior using sequence in an insert trigger - that's the only case when supportsIdentity should be set to true: in this case all the sequences that have shouldAcquireValueAfterInsert set to true will keep this setting (it would've been reversed in case identity is not supported). Note that with supportsIdentity==true attempt to create tables that have identity fields will fail - Oracle doesn't support identity. Therefore if there's table creation reqiured it should be done with supportsIdentity==false, then set the flag to true and reset sequencing (or logout and login the session).
-
supportsStoredFunctions
public boolean supportsStoredFunctions()
INTERNAL: Return if database stored functions are supported.- Overrides:
supportsStoredFunctions
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsVPD
public boolean supportsVPD()
Oracle db supports VPD.- Overrides:
supportsVPD
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsSelectForUpdateNoWait
public boolean supportsSelectForUpdateNoWait()
Returns true if the database supports SQL syntax not to wait on a SELECT..FOR UPADTE (i.e. In Oracle adding NOWAIT to the end will accomplish this)
-
canUnwrapOracleConnection
public boolean canUnwrapOracleConnection()
INTERNAL: Indicates whether this Oracle platform can unwrap Oracle connection.
-
unwrapOracleConnection
public Connection unwrapOracleConnection(Connection connection)
INTERNAL: If can unwrap returns unwrapped Oracle connection, otherwise original connection.
-
useJDBCStoredProcedureSyntax
public boolean useJDBCStoredProcedureSyntax()
Return true if JDBC syntax should be used for stored procedure calls.
-
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. This implementation works MaxRows and FirstResult into the SQL using Oracle's ROWNUM to filter values if shouldUseRownumFiltering is true.- Overrides:
printSQLSelectStatement
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isAlterSequenceObjectSupported
public boolean isAlterSequenceObjectSupported()
INTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.- Overrides:
isAlterSequenceObjectSupported
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isForUpdateCompatibleWithDistinct
public boolean isForUpdateCompatibleWithDistinct()
INTERNAL: Indicates whether SELECT DISTINCT ... FOR UPDATE is allowed by the platform (Oracle doesn't allow this).- Overrides:
isForUpdateCompatibleWithDistinct
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isLobCompatibleWithDistinct
public boolean isLobCompatibleWithDistinct()
INTERNAL: Indicates whether SELECT DISTINCT lob FROM ... (where lob is BLOB or CLOB) is allowed by the platform (Oracle doesn't allow this).- Overrides:
isLobCompatibleWithDistinct
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isLockTimeoutException
public boolean isLockTimeoutException(DatabaseException e)
Return true if the given exception occurred as a result of a lock time out exception (WAIT clause).- Overrides:
isLockTimeoutException
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
wasFailureCommunicationBased
public boolean wasFailureCommunicationBased(SQLException exception, Connection connection, org.eclipse.persistence.internal.sessions.AbstractSession sessionForProfile)
INTERNAL: A call to this method will perform a platform based check on the connection and exception error code to determine if the connection is still valid or if a communication error has occurred. If a communication error has occurred then the query may be retried. If this platform is unable to determine if the error was communication based it will return false forcing the error to be thrown to the user.- Overrides:
wasFailureCommunicationBased
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintForUpdateClause
public boolean shouldPrintForUpdateClause()
- Overrides:
shouldPrintForUpdateClause
in classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
-