org.hibernate.dialect

Class OracleDialect


public class OracleDialect
extends Oracle9Dialect

An SQL dialect for Oracle, compatible with Oracle 8.
Author:
Gavin King

Field Summary

Fields inherited from class org.hibernate.dialect.Dialect

CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE

Constructor Summary

OracleDialect()

Method Summary

CaseFragment
createCaseFragment()
Create a CaseFragment strategy responsible for handling this dialect's variations in how CASE statements are handled.
JoinFragment
createOuterJoinFragment()
Create a JoinFragment strategy responsible for handling this dialect's variations in how joins are handled.
String
getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the current timestamp.
String
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the database.
String
getLimitString(String sql, boolean hasOffset)
Apply s limit clause to the query.
String
getSelectClauseNullString(int sqlType)
Given a java.sql.Types type code, determine an appropriate null value to use in a select clause.

Methods inherited from class org.hibernate.dialect.Oracle9Dialect

bindLimitParametersInReverseOrder, dropConstraints, dropTemporaryTableAfterUse, forUpdateOfColumns, generateTemporaryTableName, getAddColumnString, getCascadeConstraintsString, getCreateSequenceString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSelectString, getDropSequenceString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getLimitString, getQuerySequencesString, getResultSet, getSelectGUIDString, getSelectSequenceNextValString, getSequenceNextValString, getViolatedConstraintNameExtracter, isCurrentTimestampSelectStringCallable, registerResultSetOutParameter, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsLimit, supportsPooledSequences, supportsSequences, supportsTemporaryTables, supportsUnionAll, useMaxForLimit

Methods inherited from class org.hibernate.dialect.Dialect

appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropConstraints, dropTemporaryTableAfterUse, forUpdateOfColumns, generateTemporaryTableName, getAddColumnString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCastTypeName, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSQLFunctionName, getCurrentTimestampSelectString, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getIdentitySelectString, getKeywords, getLimitString, getLimitString, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getQuerySequencesString, getResultSet, getSelectClauseNullString, getSelectGUIDString, getSelectSequenceNextValString, getSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isCurrentTimestampSelectStringCallable, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIdentityColumns, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimit, supportsLimitOffset, supportsLobValueChangePropogation, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporaryTables, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob, useMaxForLimit

Constructor Details

OracleDialect

public OracleDialect()

Method Details

createCaseFragment

public CaseFragment createCaseFragment()
Create a CaseFragment strategy responsible for handling this dialect's variations in how CASE statements are handled.
Overrides:
createCaseFragment in interface Dialect
Returns:
This dialect's CaseFragment strategy.

createOuterJoinFragment

public JoinFragment createOuterJoinFragment()
Create a JoinFragment strategy responsible for handling this dialect's variations in how joins are handled.
Overrides:
createOuterJoinFragment in interface Dialect
Returns:
This dialect's JoinFragment strategy.

getCurrentTimestampSQLFunctionName

public String getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the current timestamp.
Overrides:
getCurrentTimestampSQLFunctionName in interface Dialect
Returns:
The function name.

getCurrentTimestampSelectString

public String getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the database.
Overrides:
getCurrentTimestampSelectString in interface Oracle9Dialect
Returns:
The command.

getLimitString

public String getLimitString(String sql,
                             boolean hasOffset)
Apply s limit clause to the query.

Typically dialects utilize variable limit caluses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offest since we will just be using placeholders.

Here we do still pass along whether or not an offset was specified so that dialects not supporting offsets can generate proper exceptions. In general, dialects will override one or the other of this method and Dialect.getLimitString(String,int,int).

Overrides:
getLimitString in interface Oracle9Dialect
Parameters:
hasOffset - Is the query requesting an offset?
Returns:
the modified SQL

getSelectClauseNullString

public String getSelectClauseNullString(int sqlType)
Given a java.sql.Types type code, determine an appropriate null value to use in a select clause.

One thing to consider here is that certain databases might require proper casting for the nulls here since the select here will be part of a UNION/UNION ALL.

Overrides:
getSelectClauseNullString in interface Dialect
Parameters:
sqlType - The java.sql.Types type code.
Returns:
The appropriate select clause value fragment.