public class OraclePlatform extends DatabasePlatform
Purpose: Provides Oracle specific behaviour.
Responsibilities:
classTypes, cursorCode, fieldTypes, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, supportsAutoCommit, transactionIsolation, usesByteArrayBinding, usesNativeSQL, usesStreamsForBinding, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery
Constructor and Description |
---|
OraclePlatform() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsSizeInProcedureArguments()
INTERNAL:
Used for sp defs.
|
protected void |
appendByteArray(byte[] bytes,
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 void |
appendCalendar(Calendar calendar,
Writer writer)
INTERNAL:
Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendDate(Date date,
Writer writer)
INTERNAL:
Appends an Oracle specific date if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTime(Time time,
Writer writer)
INTERNAL:
Appends an Oracle specific time if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTimestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
ExpressionOperator |
atan2Operator()
INTERNAL:
Build operator.
|
DatabaseCall |
buildCallWithReturning(SQLCall sqlCall,
Vector returnFields)
INTERNAL
Returns null unless the platform supports call with returning
|
protected Hashtable |
buildClassTypes()
Return the mapping of class types to database types for the schema framework.
|
protected Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForNativeSequence(String seqName,
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.
|
protected ExpressionOperator |
currentDateOperator() |
protected ExpressionOperator |
currentTimeOperator() |
String |
getAssignmentString()
INTERNAL
Used for stored function calls.
|
String |
getBatchBeginString()
INTERNAL:
Used for batch writing and sp defs.
|
String |
getBatchEndString()
INTERNAL:
Used for batch writing and sp defs.
|
String |
getJDBCOuterJoinString()
Returns the JDBC outer join operator for SELECT statements.
|
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,
AbstractSession session)
INTERNAL:
Return the catalog information through using the native SQL catalog selects.
|
Object |
getObjectFromResultSet(ResultSet resultSet,
int columnNumber,
int type)
INTERNAL:
Get a timestamp value from a result set.
|
String |
getProcedureArgumentSetter()
INTERNAL:
Used for sp calls.
|
String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
String |
getProcedureCallTail()
INTERNAL:
Used for sp calls.
|
protected String |
getQualifiedSequenceName(String seqName)
INTERNAL:
Prepend sequence name with table qualifier (if any)
|
String |
getSelectForUpdateString()
INTERNAL:
|
String |
getStoredProcedureParameterPrefix()
INTERNAL:
|
String |
getStoredProcedureTerminationToken()
INTERNAL:
|
ValueReadQuery |
getSystemChangeNumberQuery()
INTERNAL:
The query to select the current system change number
from Oracle.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp
from the server for Oracle.
|
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
boolean |
isOracle() |
protected ExpressionOperator |
logOperator()
INTERNAL:
Create the log operator for this platform
|
Hashtable |
maximumNumericValues()
INTERNAL:
Builds a table of maximum numeric values keyed on java class.
|
Hashtable |
minimumNumericValues()
INTERNAL:
Builds a table of minimum numeric values keyed on java class.
|
protected ExpressionOperator |
operatorLocate()
INTERNAL:
Override the default locate operator
|
protected ExpressionOperator |
operatorLocate2()
INTERNAL:
Override the default locate operator
|
protected ExpressionOperator |
operatorOuterJoin()
INTERNAL:
Create the outer join operator for this platform
|
void |
printFieldNullClause(Writer writer)
INTERNAL:
Append the receiver's field 'NULL' constraint clause to a writer.
|
String |
serverTimestampString()
INTERNAL:
Return the current date and time from the server.
|
void |
setPrimitiveParameterValue(PreparedStatement statement,
int index,
Object parameter)
INTERNAL:
Set a primitive parameter.
|
boolean |
shouldPrintOuterJoinInWhereClause()
INTERNAL:
Some database require outer joins to be given in the where clause, others require it in the from clause.
|
boolean |
shouldUseJDBCOuterJoinSyntax()
INTERNAL:
JDBC defines and outer join syntax, many drivers do not support this.
|
boolean |
supportsNativeSequenceNumbers()
INTERNAL:
Return true if the receiver uses host sequence numbers, generated on the database.
|
boolean |
supportsSelectForUpdateNoWait()
INTERNAL:
Returns true if the database supports SQL syntax not to wait on a SELECT..FOR UPADTE
(i.e.
|
boolean |
supportsStoredFunctions()
INTERNAL:
|
protected ExpressionOperator |
todayOperator()
INTERNAL:
Create the sysdate operator for this platform
|
appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildSelectQueryForNativeSequence, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, executeStoredProcedure, getBatchDelimiterString, getClassTypes, getConstraintDeletionString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlPrefix, getCreateTempTableSqlSuffix, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getInOutputProcedureToken, getJDBCType, getJDBCType, getJdbcTypeName, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getOutputProcedureToken, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureEndString, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStringBindingSize, getTempTableForTable, getTransactionIsolation, isInformixOuterJoin, isNullAllowedInSelectClause, printFieldIdentityClause, printFieldIdentityClause, printFieldNotNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, processResultSet, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, rollbackTransaction, setClassTypes, setCursorCode, setFieldTypes, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesByteArrayBinding, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAcquireSequenceValueAfterInsert, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceAcquireValueAfterInsert, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintInOutputTokenBeforeType, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsLocalTempTables, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeUpdateOriginalFromTempTableSql
addOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isHSQL, isInformix, isMySQL, isODBC, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isTimesTen, platformSpecificSequencingInitialization, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequence
public boolean allowsSizeInProcedureArguments()
allowsSizeInProcedureArguments
in class DatabasePlatform
protected void appendByteArray(byte[] bytes, Writer writer) throws IOException
appendByteArray
in class DatabasePlatform
IOException
protected void appendDate(Date date, Writer writer) throws IOException
appendDate
in class DatabasePlatform
IOException
protected void appendTime(Time time, Writer writer) throws IOException
appendTime
in class DatabasePlatform
IOException
protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
appendTimestamp
in class DatabasePlatform
IOException
protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
appendCalendar
in class DatabasePlatform
IOException
public ExpressionOperator atan2Operator()
protected Hashtable buildFieldTypes()
DatabasePlatform
buildFieldTypes
in class DatabasePlatform
protected Hashtable buildClassTypes()
buildClassTypes
in class DatabasePlatform
public DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields)
buildCallWithReturning
in class DatabasePlatform
public boolean canBuildCallWithReturning()
canBuildCallWithReturning
in class DatabasePlatform
public String getAssignmentString()
getAssignmentString
in class DatabasePlatform
public String getBatchBeginString()
getBatchBeginString
in class DatabasePlatform
public String getBatchEndString()
getBatchEndString
in class DatabasePlatform
public String getJDBCOuterJoinString()
getJDBCOuterJoinString
in class DatabasePlatform
public int getMaxFieldNameSize()
getMaxFieldNameSize
in class DatabasePlatform
public Vector getNativeTableInfo(String table, String creator, AbstractSession session)
public String getProcedureArgumentSetter()
getProcedureArgumentSetter
in class DatabasePlatform
public String getProcedureCallHeader()
getProcedureCallHeader
in class DatabasePlatform
public String getProcedureCallTail()
getProcedureCallTail
in class DatabasePlatform
public String getSelectForUpdateString()
getSelectForUpdateString
in class DatabasePlatform
public String getStoredProcedureParameterPrefix()
getStoredProcedureParameterPrefix
in class DatabasePlatform
public String getStoredProcedureTerminationToken()
getStoredProcedureTerminationToken
in class DatabasePlatform
public ValueReadQuery getSystemChangeNumberQuery()
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
getTimestampQuery
in class DatasourcePlatform
public Object getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type) throws SQLException
getObjectFromResultSet
in class DatabasePlatform
SQLException
oracle.toplink.essentials.oraclespecific.Oracle9Platform
protected void initializePlatformOperators()
initializePlatformOperators
in class DatasourcePlatform
public boolean isOracle()
isOracle
in interface Platform
isOracle
in class DatasourcePlatform
protected ExpressionOperator logOperator()
public Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
maximumNumericValues
in class DatabasePlatform
public Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
minimumNumericValues
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence(String seqName, Integer size)
buildSelectQueryForNativeSequence
in class DatabasePlatform
sequenceName
- Name known by Oracle to be a defined sequenceprotected String getQualifiedSequenceName(String seqName)
protected ExpressionOperator operatorOuterJoin()
protected ExpressionOperator operatorLocate()
protected ExpressionOperator operatorLocate2()
public void printFieldNullClause(Writer writer) throws ValidationException
printFieldNullClause
in class DatabasePlatform
ValidationException
public String serverTimestampString()
public void setPrimitiveParameterValue(PreparedStatement statement, int index, Object parameter) throws SQLException
setPrimitiveParameterValue
in class DatabasePlatform
SQLException
public boolean shouldPrintOuterJoinInWhereClause()
shouldPrintOuterJoinInWhereClause
in class DatabasePlatform
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class DatabasePlatform
public boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers
in class DatabasePlatform
public boolean supportsStoredFunctions()
supportsStoredFunctions
in class DatabasePlatform
public boolean supportsSelectForUpdateNoWait()
protected ExpressionOperator todayOperator()
protected ExpressionOperator currentDateOperator()
protected ExpressionOperator currentTimeOperator()
Copyright © 2021. All rights reserved.