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

public Class OraclePlatform

extends DatabasePlatform
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.database.Oracle8Platform
Imports
java.io.CharArrayWriter, .IOException, .StringWriter, .Writer, java.sql.Connection, .DatabaseMetaData, .ResultSet, .SQLException, .Types, java.util.ArrayList, .Calendar, .Hashtable, .Iterator, .List, .Vector, java.util.regex.Pattern, org.eclipse.persistence.exceptions.DatabaseException, .ValidationException, org.eclipse.persistence.expressions.Expression, .ExpressionOperator, org.eclipse.persistence.internal.expressions.ExtractOperator, .ExpressionJavaPrinter, .ExpressionSQLPrinter, .FunctionExpression, .RelationExpression, .SQLSelectStatement, org.eclipse.persistence.internal.databaseaccess.DatabaseCall, .DatasourceCall.ParameterType, .FieldTypeDefinition, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, .DatabaseTable, .Helper, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.sessions.AbstractSession, .DatabaseSessionImpl, org.eclipse.persistence.queries.DataModifyQuery, .DataReadQuery, .DatabaseQuery, .ObjectBuildingQuery, .ReadQuery, .SQLCall, .StoredProcedureCall, .ValueReadQuery, org.eclipse.persistence.tools.schemaframework.TableDefinition

Purpose: Provides Oracle specific behavior.

Responsibilities:

Since
TOPLink/Java 1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected boolean
shouldPrintForUpdateClause

Whether a FOR UPDATE clause should be printed at the end of the query

protected boolean
supportsIdentity

Advanced attribute indicating whether identity is supported, see comment to setSupportsIdentity method.

protected static DataModifyQuery
protected static DataModifyQuery
Inherited from org.eclipse.persistence.platform.database.DatabasePlatform:
DEFAULT_VARCHAR_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
appendByteArray(byte[] bytes, Writer writer)

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

INTERNAL: If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format as provided in DatabasePlatform.
protected void
appendCalendar(Calendar calendar, Writer writer)

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

INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
protected void
appendDate(Date date, Writer writer)

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

INTERNAL: Appends an Oracle specific date if usesNativeSQL is true otherwise use the ODBC format.
protected void
appendTime(Time time, Writer writer)

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

INTERNAL: Appends an Oracle specific time if usesNativeSQL is true otherwise use the ODBC format.
protected void
appendTimestamp(Timestamp timestamp, Writer writer)

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

INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
public DatabaseCall
buildCallWithReturning(SQLCall sqlCall, Vector<DatabaseField> returnFields)

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

INTERNAL: Returns null unless the platform supports call with returning
protected Hashtable<Class<?>, FieldTypeDefinition>
protected String
buildFirstRowsHint(int max)

Build the hint string used for first rows.

public ValueReadQuery
buildSelectQueryForIdentity(String
known by Oracle to be a defined sequence
qualifiedSeqName
,
Integer size)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.buildSelectQueryForIdentity.

INTERNAL: Though Oracle doesn't support identity it could be imitated, see comment to setSupportsIdentity method.
public ValueReadQuery
buildSelectQueryForSequenceObject(String
known by Oracle to be a defined sequence
qualifiedSeqName
,
Integer size)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.buildSelectQueryForSequenceObject.

INTERNAL: Produce a DataReadQuery which updates(!) the sequence number in the db and returns it.
public boolean
canBuildCallWithReturning()

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

INTERNAL: Indicates whether the platform can build call with returning.
public boolean
canUnwrapOracleConnection()

INTERNAL: Indicates whether this Oracle platform can unwrap Oracle connection.

public boolean

Returns:

value of true if given table exists or false otherwise
checkTableExists
(final DatabaseSessionImpl
current database session
session
,
final TableDefinition
database table meta-data
table
,
final boolean
whether to suppress logging during query execution
suppressLogging
)

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

INTERNAL: Executes and evaluates query to check whether given table exists.
public void
clearOracleConnectionCache(Connection conn)

INTERNAL: Clears both implicit and explicit caches of OracleConnection on Oracle9Platform, noop here.

public Expression
createExpressionFor(DatabaseField field, Expression builder, String fieldClassificationClassName)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.createExpressionFor.

INTERNAL: Override this method if the platform needs to use a custom function based on the DatabaseField
private void
protected static ExpressionOperator
exceptOperator()

INTERNAL: Create the EXCEPT operator, MINUS in Oracle.

public String
public String
public String
public String
public String
public String
public String
getDeclareBeginString()

INTERNAL: DECLARE stanza header for Anonymous PL/SQL block

public String
getDropCascadeString()

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

Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.
public String
public int
getINClauseLimit()

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.getINClauseLimit.

INTERNAL: Some database platforms have a limit for the number of parameters in an IN clause.
public int
getMaxFieldNameSize()

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

INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.
public Vector<E>
getNativeTableInfo(String table, String creator, AbstractSession session)

Return the catalog information through using the native SQL catalog selects.

public Object
getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type, AbstractSession session)

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

INTERNAL: Get a timestamp value from a result set.
private String
public String
public String
public String
public String
public String
getSelectForUpdateWaitString(Integer waitTimeout)

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

Platforms that support the WAIT option should override this method.
public String
public ValueReadQuery
getSystemChangeNumberQuery()

PUBLIC: The query to select the current system change number from Oracle.

protected DataReadQuery

Returns:

query to check whether given table exists
getTableExistsQuery
(final TableDefinition
database table meta-data
table
)

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

INTERNAL: Returns query to check whether given table exists.
public ValueReadQuery
getTimestampQuery()

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.getTimestampQuery.

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

PUBLIC: This method returns the query to select the timestamp from the server for Oracle.
public DatabaseQuery
getVPDClearIdentifierQuery(String vpdIdentifier)

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

INTERNAL: Return an Oracle defined VPD clear identifier query.
public String
getVPDCreationFunctionString(String tableName, String tenantFieldName)

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

INTERNAL: Return an Oracle defined VPD identifier function.
public String
getVPDCreationPolicyString(String tableName, AbstractSession session)

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

INTERNAL: Return an Oracle defined VPD identifier policy.
public String
getVPDDeletionString(String tableName, AbstractSession session)

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

INTERNAL: Return an Oracle defined VPD identifier policy deletion.
public DatabaseQuery
getVPDSetIdentifierQuery(String vpdIdentifier)

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

INTERNAL: Return an Oracle defined VPD set identifier query.
public void
protected void
public boolean
isAlterSequenceObjectSupported()

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

INTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.
public boolean
public boolean
public boolean
isLockTimeoutException(DatabaseException e)

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

Return true if the given exception occurred as a result of a lock time out exception (WAIT clause).
public boolean
isNativeConnectionRequiredForLobLocator()

INTERNAL: Used by derived platforms (Oracle8Platform and higher) to indicate whether app.

public boolean
public boolean
isRowCountOutputParameterRequired()

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

Oracle does not return the row count from PLSQL anon blocks, so an output parameter is required for this.
protected static ExpressionOperator
logOperator()

Create the log operator for this platform

public Hashtable<Class<? extends Number>, ? super Number>
maximumNumericValues()

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

Builds a table of maximum numeric values keyed on java class.
public Hashtable<Class<? extends Number>, ? super Number>
minimumNumericValues()

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

Builds a table of minimum numeric values keyed on java class.
protected static ExpressionOperator
operatorLocate()

INTERNAL: Used by derived platforms (Oracle8Platform and higher) to indicate whether app.

protected static ExpressionOperator
operatorLocate2()

INTERNAL: Override the default locate operator

protected static ExpressionOperator
operatorOuterJoin()

Create the outer join operator for this platform

protected static ExpressionOperator
oracleDateName()

INTERNAL: Oracle equivalent to DATENAME is TO_CHAR.

private static ExpressionOperator
public void
printFieldNullClause(Writer writer)

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

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

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

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

INTERNAL: Create the REGEXP_LIKE operator.

public String
serverTimestampString()

Return the current date and time from the server.

public void
setSupportsIdentity(boolean supportsIdentity)

ADVANCED: Oracle db doesn't support identity.

public boolean
public boolean
shouldPrintStoredProcedureArgumentNameInCall()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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 = ?)
public boolean
shouldUseJDBCOuterJoinSyntax()

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

JDBC defines and outer join syntax, many drivers do not support this.
public boolean
supportsAutoConversionToNumericForArithmeticOperations()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.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 ...
public boolean
supportsIdentity()

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.supportsIdentity.

INTERNAL: Indicates whether the platform supports identity.
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)

public boolean
supportsSequenceObjects()

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.supportsSequenceObjects.

INTERNAL: Indicates whether the platform supports sequence objects.
public boolean
supportsStoredFunctions()

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

INTERNAL: Return if database stored functions are supported.
public boolean
public boolean
supportsWaitForUpdate()

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

INTERNAL: Indicates whether the platform supports timeouts on For Update
public Connection
unwrapOracleConnection(Connection connection)

INTERNAL: If can unwrap returns unwrapped Oracle connection, otherwise original connection.

public boolean
useJDBCStoredProcedureSyntax()

Return true if JDBC syntax should be used for stored procedure calls.

public boolean
wasFailureCommunicationBased(SQLException exception, Connection connection, AbstractSession sessionForProfile)

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

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.