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:
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:
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.
- See Also:
- Serialized Form
- Since:
- TOPLink/Java 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringBRACKET_ENDprotected java.lang.StringEND_FROMprotected java.lang.StringEND_FROM_IDprotected java.lang.StringFROMprotected java.lang.StringFROM_IDprotected java.lang.StringHINT_ENDprotected java.lang.StringHINT_STARTprotected java.lang.StringLOCK_ENDprotected java.lang.StringLOCK_START_PREFIXprotected java.lang.StringLOCK_START_PREFIX_WHEREprotected java.lang.StringLOCK_START_SUFFIXprotected java.lang.StringMAX_ROWprotected java.lang.StringMIN_ROWprotected java.lang.StringORDER_BY_IDprotected java.lang.StringSELECTprotected java.lang.StringSELECT_ID_PREFIXprotected java.lang.StringSELECT_ID_SUFFIXprotected booleanshouldPrintForUpdateClauseWhether a FOR UPDATE clause should be printed at the end of the queryprotected booleansupportsIdentityAdvanced attribute indicating whether identity is supported, see comment to setSupportsIdentity method.protected static DataModifyQueryvpdClearIdentifierQueryprotected static DataModifyQueryvpdSetIdentifierQuery-
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 OraclePlatform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsSizeInProcedureArguments()protected voidappendByteArray(byte[] bytes, java.io.Writer writer)INTERNAL: If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format as provided in DatabasePlatform.protected voidappendCalendar(java.util.Calendar calendar, java.io.Writer writer)INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.protected voidappendDate(java.sql.Date date, java.io.Writer writer)INTERNAL: Appends an Oracle specific date if usesNativeSQL is true otherwise use the ODBC format.protected voidappendTime(java.sql.Time time, java.io.Writer writer)INTERNAL: Appends an Oracle specific time if usesNativeSQL is true otherwise use the ODBC format.protected voidappendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer)INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.org.eclipse.persistence.internal.databaseaccess.DatabaseCallbuildCallWithReturning(SQLCall sqlCall, java.util.Vector returnFields)INTERNAL: Returns null unless the platform supports call with returningprotected java.util.HashtablebuildFieldTypes()INTERNAL:protected java.lang.StringbuildFirstRowsHint(int max)Build the hint string used for first rows.ValueReadQuerybuildSelectQueryForIdentity(java.lang.String qualifiedSeqName, java.lang.Integer size)INTERNAL: Though Oracle doesn't support identity it could be imitated, see comment to setSupportsIdentity method.ValueReadQuerybuildSelectQueryForSequenceObject(java.lang.String qualifiedSeqName, java.lang.Integer size)INTERNAL: Produce a DataReadQuery which updates(!)booleancanBuildCallWithReturning()INTERNAL: Indicates whether the platform can build call with returning.booleancanUnwrapOracleConnection()INTERNAL: Indicates whether this Oracle platform can unwrap Oracle connection.booleancheckTableExists(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session, TableDefinition table, boolean suppressLogging)INTERNAL: Executes and evaluates query to check whether given table exists.voidclearOracleConnectionCache(java.sql.Connection conn)INTERNAL: Clears both implicit and explicit caches of OracleConnection on Oracle9Platform, noop here.ExpressioncreateExpressionFor(org.eclipse.persistence.internal.helper.DatabaseField field, Expression builder, java.lang.String fieldClassificationClassName)protected static ExpressionOperatorexceptOperator()INTERNAL: Create the EXCEPT operator, MINUS in Oracle.java.lang.StringgetAssignmentString()INTERNAL: Used for stored function calls.java.lang.StringgetBatchBeginString()Used for batch writing and sp defs.java.lang.StringgetBatchEndString()Used for batch writing and sp defs.java.lang.StringgetBatchRowCountAssignString()Used for batch writing for row count return.java.lang.StringgetBatchRowCountDeclareString()Used for batch writing for row count return.java.lang.StringgetBatchRowCountReturnString()Used for batch writing for row count return.java.lang.StringgetDeclareBeginString()INTERNAL: DECLARE stanza header for Anonymous PL/SQL blockjava.lang.StringgetDropCascadeString()Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.java.lang.StringgetDropDatabaseSchemaString(java.lang.String schema)Return the drop schema definition.intgetINClauseLimit()intgetMaxFieldNameSize()INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.java.util.VectorgetNativeTableInfo(java.lang.String table, java.lang.String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)Return the catalog information through using the native SQL catalog selects.java.lang.ObjectgetObjectFromResultSet(java.sql.ResultSet resultSet, int columnNumber, int type, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Get a timestamp value from a result set.java.lang.StringgetProcedureArgument(java.lang.String name, java.lang.Object parameter, org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType parameterType, StoredProcedureCall call, org.eclipse.persistence.internal.sessions.AbstractSession session)java.lang.StringgetProcedureCallHeader()Used for sp calls.java.lang.StringgetProcedureCallTail()Used for sp calls.java.lang.StringgetSelectForUpdateString()java.lang.StringgetSelectForUpdateWaitString(java.lang.Integer waitTimeout)java.lang.StringgetStoredProcedureParameterPrefix()ValueReadQuerygetSystemChangeNumberQuery()PUBLIC: The query to select the current system change number from Oracle.protected DataReadQuerygetTableExistsQuery(TableDefinition table)INTERNAL: Returns query to check whether given table exists.ValueReadQuerygetTimestampQuery()PUBLIC: This method returns the query to select the timestamp from the server for Oracle.DatabaseQuerygetVPDClearIdentifierQuery(java.lang.String vpdIdentifier)INTERNAL: Return an Oracle defined VPD clear identifier query.java.lang.StringgetVPDCreationFunctionString(java.lang.String tableName, java.lang.String tenantFieldName)INTERNAL: Return an Oracle defined VPD identifier function.java.lang.StringgetVPDCreationPolicyString(java.lang.String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an Oracle defined VPD identifier policy.java.lang.StringgetVPDDeletionString(java.lang.String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an Oracle defined VPD identifier policy deletion.DatabaseQuerygetVPDSetIdentifierQuery(java.lang.String vpdIdentifier)INTERNAL: Return an Oracle defined VPD set identifier query.voidinitializeConnectionData(java.sql.Connection connection)protected voidinitializePlatformOperators()Initialize any platform-specific operatorsbooleanisAlterSequenceObjectSupported()INTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.booleanisForUpdateCompatibleWithDistinct()INTERNAL: Indicates whether SELECT DISTINCT ...booleanisLobCompatibleWithDistinct()INTERNAL: Indicates whether SELECT DISTINCT lob FROM ...booleanisLockTimeoutException(DatabaseException e)Return true if the given exception occurred as a result of a lock time out exception (WAIT clause).booleanisNativeConnectionRequiredForLobLocator()INTERNAL: Used by derived platforms (Oracle8Platform and higher) to indicate whether app. server should unwrap connection to use lob locator.booleanisOracle()booleanisRowCountOutputParameterRequired()Oracle does not return the row count from PLSQL anon blocks, so an output parameter is required for this.protected static ExpressionOperatorlogOperator()Create the log operator for this platformjava.util.HashtablemaximumNumericValues()Builds a table of maximum numeric values keyed on java class.java.util.HashtableminimumNumericValues()Builds a table of minimum numeric values keyed on java class.protected static ExpressionOperatoroperatorLocate()INTERNAL: Override the default locate operatorprotected static ExpressionOperatoroperatorLocate2()INTERNAL: Override the default locate operatorprotected static ExpressionOperatoroperatorOuterJoin()Create the outer join operator for this platformprotected static ExpressionOperatororacleDateName()INTERNAL: Oracle equivalent to DATENAME is TO_CHAR.voidprintFieldNullClause(java.io.Writer writer)INTERNAL: Append the receiver's field 'NULL' 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.protected static ExpressionOperatorregexpOperator()INTERNAL: Create the REGEXP_LIKE operator.java.lang.StringserverTimestampString()Return the current date and time from the server.voidsetSupportsIdentity(boolean supportsIdentity)ADVANCED: Oracle db doesn't support identity.booleanshouldPrintForUpdateClause()booleanshouldPrintStoredProcedureArgumentNameInCall()INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g.booleanshouldUseJDBCOuterJoinSyntax()JDBC defines and outer join syntax, many drivers do not support this.booleansupportsAutoConversionToNumericForArithmeticOperations()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 ...booleansupportsIdentity()INTERNAL: Indicates whether the platform supports identity.booleansupportsSelectForUpdateNoWait()Returns true if the database supports SQL syntax not to wait on a SELECT..FOR UPADTE (i.e.booleansupportsSequenceObjects()INTERNAL: Indicates whether the platform supports sequence objects.booleansupportsStoredFunctions()INTERNAL: Return if database stored functions are supported.booleansupportsVPD()Oracle db supports VPD.booleansupportsWaitForUpdate()java.sql.ConnectionunwrapOracleConnection(java.sql.Connection connection)INTERNAL: If can unwrap returns unwrapped Oracle connection, otherwise original connection.booleanuseJDBCStoredProcedureSyntax()Return true if JDBC syntax should be used for stored procedure calls.booleanwasFailureCommunicationBased(java.sql.SQLException exception, java.sql.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, allowBindingForSelectClause, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getBatchDelimiterString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlPrefix, getCreateTempTableSqlSuffix, 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, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureEndString, getProcedureOptionList, 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, 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, setNullFromDatabaseField, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, 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, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAddColumnClause, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeTableCreationSuffix, writeUpdateOriginalFromTempTableSql
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, 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
-
vpdSetIdentifierQuery
protected static DataModifyQuery vpdSetIdentifierQuery
-
vpdClearIdentifierQuery
protected static DataModifyQuery vpdClearIdentifierQuery
-
shouldPrintForUpdateClause
protected boolean shouldPrintForUpdateClause
Whether a FOR UPDATE clause should be printed at the end of the query
-
supportsIdentity
protected boolean supportsIdentity
Advanced attribute indicating whether identity is supported, see comment to setSupportsIdentity method.
-
SELECT
protected java.lang.String SELECT
-
HINT_START
protected java.lang.String HINT_START
-
HINT_END
protected java.lang.String HINT_END
-
FROM
protected java.lang.String FROM
-
END_FROM
protected java.lang.String END_FROM
-
MAX_ROW
protected java.lang.String MAX_ROW
-
MIN_ROW
protected java.lang.String MIN_ROW
-
LOCK_START_PREFIX
protected java.lang.String LOCK_START_PREFIX
-
LOCK_START_PREFIX_WHERE
protected java.lang.String LOCK_START_PREFIX_WHERE
-
LOCK_START_SUFFIX
protected java.lang.String LOCK_START_SUFFIX
-
LOCK_END
protected java.lang.String LOCK_END
-
SELECT_ID_PREFIX
protected java.lang.String SELECT_ID_PREFIX
-
SELECT_ID_SUFFIX
protected java.lang.String SELECT_ID_SUFFIX
-
FROM_ID
protected java.lang.String FROM_ID
-
END_FROM_ID
protected java.lang.String END_FROM_ID
-
ORDER_BY_ID
protected java.lang.String ORDER_BY_ID
-
BRACKET_END
protected java.lang.String BRACKET_END
-
-
Method Detail
-
initializeConnectionData
public void initializeConnectionData(java.sql.Connection connection) throws java.sql.SQLException- Overrides:
initializeConnectionDatain classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.sql.SQLException
-
allowsSizeInProcedureArguments
public boolean allowsSizeInProcedureArguments()
- Overrides:
allowsSizeInProcedureArgumentsin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
appendByteArray
protected void appendByteArray(byte[] bytes, java.io.Writer writer) throws java.io.IOExceptionINTERNAL: If using native SQL then print a byte[] literally as a hex string otherwise use ODBC format as provided in DatabasePlatform.- Overrides:
appendByteArrayin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.io.IOException
-
appendDate
protected void appendDate(java.sql.Date date, java.io.Writer writer) throws java.io.IOExceptionINTERNAL: Appends an Oracle specific date if usesNativeSQL is true otherwise use the ODBC format. Native FORMAT: to_date('1997-11-06','yyyy-mm-dd')- Overrides:
appendDatein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.io.IOException
-
appendTime
protected void appendTime(java.sql.Time time, java.io.Writer writer) throws java.io.IOExceptionINTERNAL: Appends an Oracle specific time if usesNativeSQL is true otherwise use the ODBC format. Native FORMAT: to_date(#####, 'sssss').- Overrides:
appendTimein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.io.IOException
-
appendTimestamp
protected void appendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer) throws java.io.IOExceptionINTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. Native Format: to_date ('1997-11-06 10:35:45.0' , 'yyyy-mm-dd hh:mm:ss.n')- Overrides:
appendTimestampin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.io.IOException
-
appendCalendar
protected void appendCalendar(java.util.Calendar calendar, java.io.Writer writer) throws java.io.IOExceptionINTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format. Native Format: to_date ('1997-11-06 10:35:45.0' , 'yyyy-mm-dd hh:mm:ss.n')- Overrides:
appendCalendarin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.io.IOException
-
buildFieldTypes
protected java.util.Hashtable buildFieldTypes()
INTERNAL:- Overrides:
buildFieldTypesin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
buildFirstRowsHint
protected java.lang.String buildFirstRowsHint(int max)
Build the hint string used for first rows. Allows it to be overridden- Parameters:
max-- Returns:
-
buildCallWithReturning
public org.eclipse.persistence.internal.databaseaccess.DatabaseCall buildCallWithReturning(SQLCall sqlCall, java.util.Vector returnFields)
INTERNAL: Returns null unless the platform supports call with returning- Overrides:
buildCallWithReturningin 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:
canBuildCallWithReturningin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
clearOracleConnectionCache
public void clearOracleConnectionCache(java.sql.Connection conn)
INTERNAL: Clears both implicit and explicit caches of OracleConnection on Oracle9Platform, noop here.
-
getAssignmentString
public java.lang.String getAssignmentString()
INTERNAL: Used for stored function calls.- Overrides:
getAssignmentStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDeclareBeginString
public java.lang.String getDeclareBeginString()
INTERNAL: DECLARE stanza header for Anonymous PL/SQL block
-
getBatchBeginString
public java.lang.String getBatchBeginString()
Used for batch writing and sp defs.- Overrides:
getBatchBeginStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchEndString
public java.lang.String getBatchEndString()
Used for batch writing and sp defs.- Overrides:
getBatchEndStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountDeclareString
public java.lang.String getBatchRowCountDeclareString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountDeclareStringin 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:
isRowCountOutputParameterRequiredin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountReturnString
public java.lang.String getBatchRowCountReturnString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountReturnStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDropDatabaseSchemaString
public java.lang.String getDropDatabaseSchemaString(java.lang.String schema)
Return the drop schema definition. Subclasses should override as needed.- Overrides:
getDropDatabaseSchemaStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getBatchRowCountAssignString
public java.lang.String getBatchRowCountAssignString()
Used for batch writing for row count return.- Overrides:
getBatchRowCountAssignStringin 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:
getMaxFieldNameSizein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getNativeTableInfo
public java.util.Vector getNativeTableInfo(java.lang.String table, java.lang.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.
-
getProcedureCallHeader
public java.lang.String getProcedureCallHeader()
Used for sp calls.- Overrides:
getProcedureCallHeaderin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getProcedureCallTail
public java.lang.String getProcedureCallTail()
Used for sp calls.- Overrides:
getProcedureCallTailin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDropCascadeString
public java.lang.String getDropCascadeString()
Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.- Overrides:
getDropCascadeStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateString
public java.lang.String getSelectForUpdateString()
- Overrides:
getSelectForUpdateStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getSelectForUpdateWaitString
public java.lang.String getSelectForUpdateWaitString(java.lang.Integer waitTimeout)
- Overrides:
getSelectForUpdateWaitStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getStoredProcedureParameterPrefix
public java.lang.String getStoredProcedureParameterPrefix()
- Overrides:
getStoredProcedureParameterPrefixin 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:
getTimestampQueryin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
getTimestampQueryin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getVPDClearIdentifierQuery
public DatabaseQuery getVPDClearIdentifierQuery(java.lang.String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD clear identifier query.- Overrides:
getVPDClearIdentifierQueryin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDCreationFunctionString
public java.lang.String getVPDCreationFunctionString(java.lang.String tableName, java.lang.String tenantFieldName)INTERNAL: Return an Oracle defined VPD identifier function. Used for DDL generation.- Overrides:
getVPDCreationFunctionStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDCreationPolicyString
public java.lang.String getVPDCreationPolicyString(java.lang.String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an Oracle defined VPD identifier policy. Used for DDL generation.- Overrides:
getVPDCreationPolicyStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDDeletionString
public java.lang.String getVPDDeletionString(java.lang.String tableName, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an Oracle defined VPD identifier policy deletion. Used for DDL generation.- Overrides:
getVPDDeletionStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getVPDSetIdentifierQuery
public DatabaseQuery getVPDSetIdentifierQuery(java.lang.String vpdIdentifier)
INTERNAL: Return an Oracle defined VPD set identifier query.- Overrides:
getVPDSetIdentifierQueryin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getObjectFromResultSet
public java.lang.Object getObjectFromResultSet(java.sql.ResultSet resultSet, int columnNumber, int type, org.eclipse.persistence.internal.sessions.AbstractSession session) throws java.sql.SQLExceptionINTERNAL: 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:
getObjectFromResultSetin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
java.sql.SQLException
-
initializePlatformOperators
protected void initializePlatformOperators()
Initialize any platform-specific operators- Overrides:
initializePlatformOperatorsin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
operatorOuterJoin
protected static ExpressionOperator operatorOuterJoin()
Create the outer join operator for this platform
-
exceptOperator
protected static ExpressionOperator exceptOperator()
INTERNAL: Create the EXCEPT operator, MINUS in Oracle.
-
regexpOperator
protected static ExpressionOperator regexpOperator()
INTERNAL: Create the REGEXP_LIKE operator.
-
operatorLocate
protected static ExpressionOperator operatorLocate()
INTERNAL: Override the default locate operator
-
operatorLocate2
protected static ExpressionOperator operatorLocate2()
INTERNAL: Override the default locate operator
-
logOperator
protected static ExpressionOperator logOperator()
Create the log operator for this platform
-
oracleDateName
protected static ExpressionOperator oracleDateName()
INTERNAL: Oracle equivalent to DATENAME is TO_CHAR.
-
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:
isOraclein interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
isOraclein classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
maximumNumericValues
public java.util.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:
maximumNumericValuesin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
minimumNumericValues
public java.util.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:
minimumNumericValuesin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
buildSelectQueryForSequenceObject
public ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String qualifiedSeqName, java.lang.Integer size)
INTERNAL: Produce a DataReadQuery which updates(!) the sequence number in the db and returns it. Currently implemented on Oracle only.- Overrides:
buildSelectQueryForSequenceObjectin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform- Parameters:
qualifiedSeqName- known by Oracle to be a defined sequence
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity(java.lang.String qualifiedSeqName, java.lang.Integer size)
INTERNAL: Though Oracle doesn't support identity it could be imitated, see comment to setSupportsIdentity method.- Overrides:
buildSelectQueryForIdentityin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform- Parameters:
qualifiedSeqName- known by Oracle to be a defined sequence
-
printFieldNullClause
public void printFieldNullClause(java.io.Writer writer) throws ValidationExceptionINTERNAL: Append the receiver's field 'NULL' constraint clause to a writer.- Overrides:
printFieldNullClausein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
ValidationException
-
serverTimestampString
public java.lang.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:
shouldPrintStoredProcedureArgumentNameInCallin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getProcedureArgument
public java.lang.String getProcedureArgument(java.lang.String name, java.lang.Object parameter, org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType parameterType, StoredProcedureCall call, org.eclipse.persistence.internal.sessions.AbstractSession session)- Overrides:
getProcedureArgumentin 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:
shouldUseJDBCOuterJoinSyntaxin 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:
supportsAutoConversionToNumericForArithmeticOperationsin 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:
supportsSequenceObjectsin 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:
supportsIdentityin 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:
supportsStoredFunctionsin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsVPD
public boolean supportsVPD()
Oracle db supports VPD.- Overrides:
supportsVPDin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsWaitForUpdate
public boolean supportsWaitForUpdate()
- Overrides:
supportsWaitForUpdatein 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 java.sql.Connection unwrapOracleConnection(java.sql.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:
printSQLSelectStatementin 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:
isAlterSequenceObjectSupportedin 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:
isForUpdateCompatibleWithDistinctin 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:
isLobCompatibleWithDistinctin 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:
isLockTimeoutExceptionin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
wasFailureCommunicationBased
public boolean wasFailureCommunicationBased(java.sql.SQLException exception, java.sql.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:
wasFailureCommunicationBasedin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintForUpdateClause
public boolean shouldPrintForUpdateClause()
- Overrides:
shouldPrintForUpdateClausein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
createExpressionFor
public Expression createExpressionFor(org.eclipse.persistence.internal.helper.DatabaseField field, Expression builder, java.lang.String fieldClassificationClassName)
- Overrides:
createExpressionForin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getTableExistsQuery
protected DataReadQuery getTableExistsQuery(TableDefinition table)
INTERNAL: Returns query to check whether given table exists. Query execution returns a row when table exists or empty result otherwise.- Overrides:
getTableExistsQueryin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Parameters:
table- database table meta-data- Returns:
- query to check whether given table exists
-
checkTableExists
public boolean checkTableExists(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl session, TableDefinition table, boolean suppressLogging)INTERNAL: Executes and evaluates query to check whether given table exists. Returned value depends on returned result set being empty or not.- Overrides:
checkTableExistsin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Parameters:
session- current database sessiontable- database table meta-datasuppressLogging- whether to suppress logging during query execution- Returns:
- value of
trueif given table exists orfalseotherwise
-
getINClauseLimit
public int getINClauseLimit()
- Overrides:
getINClauseLimitin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
-