org.hibernate.dialect

Class IngresDialect


public class IngresDialect
extends Dialect

An Ingres SQL dialect.

Known limitations: - only supports simple constants or columns on the left side of an IN, making (1,2,3) in (...) or (

Author:
Ian Booth, Bruce Lunsford, Max Rydahl Andersen

Field Summary

Fields inherited from class org.hibernate.dialect.Dialect

CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE

Constructor Summary

IngresDialect()

Method Summary

boolean
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
String
generateTemporaryTableName(String baseTableName)
Generate a temporary table name given the bas table.
String
getAddColumnString()
The syntax used to add a column to a table (optional).
String
getCreateSequenceString(String sequenceName)
The syntax used to create a sequence, if sequences are supported.
String
getCreateTemporaryTablePostfix()
Get any fragments needing to be postfixed to the command for temporary table creation.
String
getCreateTemporaryTableString()
Command used to create a temporary table.
String
getCurrentTimestampSQLFunctionName()
Expression for current_timestamp
String
getDropSequenceString(String sequenceName)
The syntax used to drop a sequence, if sequences are supported.
String
getLimitString(String querySelect, int offset, int limit)
Add a LIMIT clause to the given SQL SELECT
String
getLowercaseFunction()
The name of the SQL function that transforms a string to lowercase
String
getNullColumnString()
The keyword used to specify a nullable column.
String
getQuerySequencesString()
A query used to find all sequences
String
getSelectSequenceNextValString(String sequenceName)
Generate the select expression fragment that will retreive the next value of a sequence as part of another (typically DML) statement.
String
getSequenceNextValString(String sequenceName)
The syntax that fetches the next value of a sequence, if sequences are supported.
boolean
supportsEmptyInList()
Does this dialect support empty IN lists?

For example, is [where XYZ in ()] a supported construct?

boolean
supportsExpectedLobUsagePattern()
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes...
boolean
supportsForUpdateOf()
Does this dialect support FOR UPDATE OF, allowing particular rows to be locked?
boolean
supportsLimit()
Does this Dialect have some kind of LIMIT syntax?
boolean
supportsLimitOffset()
Does this dialect support an offset?
boolean
supportsNotNullUnique()
Ingres explicitly needs "unique not null", because "with null" is default
boolean
supportsSequences()
Does this dialect support sequences?
boolean
supportsSubselectAsInPredicateLHS()
Are subselects supported as the left-hand-side (LHS) of IN-predicates.
boolean
supportsTemporaryTables()
Does this dialect support temporary tables?
boolean
supportsVariableLimit()
Does this dialect support bind variables (i.e., prepared statememnt parameters) for its limit/offset?
boolean
useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?

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

IngresDialect

public IngresDialect()

Method Details

dropConstraints

public boolean dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
Overrides:
dropConstraints in interface Dialect
Returns:
boolean

generateTemporaryTableName

public String generateTemporaryTableName(String baseTableName)
Generate a temporary table name given the bas table.
Overrides:
generateTemporaryTableName in interface Dialect
Parameters:
baseTableName - The table name from which to base the temp table name.
Returns:
The generated temp table name.

getAddColumnString

public String getAddColumnString()
The syntax used to add a column to a table (optional).
Overrides:
getAddColumnString in interface Dialect

getCreateSequenceString

public String getCreateSequenceString(String sequenceName)
The syntax used to create a sequence, if sequences are supported.
Overrides:
getCreateSequenceString in interface Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getCreateTemporaryTablePostfix

public String getCreateTemporaryTablePostfix()
Get any fragments needing to be postfixed to the command for temporary table creation.
Overrides:
getCreateTemporaryTablePostfix in interface Dialect
Returns:
Any required postfix.

getCreateTemporaryTableString

public String getCreateTemporaryTableString()
Command used to create a temporary table.
Overrides:
getCreateTemporaryTableString in interface Dialect
Returns:
The command used to create a temporary table.

getCurrentTimestampSQLFunctionName

public String getCurrentTimestampSQLFunctionName()
Expression for current_timestamp
Overrides:
getCurrentTimestampSQLFunctionName in interface Dialect

getDropSequenceString

public String getDropSequenceString(String sequenceName)
The syntax used to drop a sequence, if sequences are supported.
Overrides:
getDropSequenceString in interface Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getLimitString

public String getLimitString(String querySelect,
                             int offset,
                             int limit)
Add a LIMIT clause to the given SQL SELECT
Overrides:
getLimitString in interface Dialect
Returns:
the modified SQL

getLowercaseFunction

public String getLowercaseFunction()
The name of the SQL function that transforms a string to lowercase
Overrides:
getLowercaseFunction in interface Dialect
Returns:
String

getNullColumnString

public String getNullColumnString()
The keyword used to specify a nullable column.
Overrides:
getNullColumnString in interface Dialect
Returns:
String

getQuerySequencesString

public String getQuerySequencesString()
A query used to find all sequences
Overrides:
getQuerySequencesString in interface Dialect

getSelectSequenceNextValString

public String getSelectSequenceNextValString(String sequenceName)
Overrides:
getSelectSequenceNextValString in interface Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
The "nextval" fragment.

getSequenceNextValString

public String getSequenceNextValString(String sequenceName)
The syntax that fetches the next value of a sequence, if sequences are supported.
Overrides:
getSequenceNextValString in interface Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

supportsEmptyInList

public boolean supportsEmptyInList()
Does this dialect support empty IN lists?

For example, is [where XYZ in ()] a supported construct?

Overrides:
supportsEmptyInList in interface Dialect
Returns:
True if empty in lists are supported; false otherwise.
Since:
3.2

supportsExpectedLobUsagePattern

public boolean supportsExpectedLobUsagePattern()
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes...

Part of the trickiness here is the fact that this is largely driver dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers historically) actually does a pretty good job with LOB support as of the 10.2.x versions of their drivers...

Overrides:
supportsExpectedLobUsagePattern in interface Dialect
Returns:
True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
Since:
3.2

supportsForUpdateOf

public boolean supportsForUpdateOf()
Does this dialect support FOR UPDATE OF, allowing particular rows to be locked?
Returns:
True (Ingres does support "for update of" syntax...)

supportsLimit

public boolean supportsLimit()
Does this Dialect have some kind of LIMIT syntax?
Overrides:
supportsLimit in interface Dialect

supportsLimitOffset

public boolean supportsLimitOffset()
Does this dialect support an offset?
Overrides:
supportsLimitOffset in interface Dialect

supportsNotNullUnique

public boolean supportsNotNullUnique()
Ingres explicitly needs "unique not null", because "with null" is default
Overrides:
supportsNotNullUnique in interface Dialect

supportsSequences

public boolean supportsSequences()
Does this dialect support sequences?
Overrides:
supportsSequences in interface Dialect
Returns:
boolean

supportsSubselectAsInPredicateLHS

public boolean supportsSubselectAsInPredicateLHS()
Are subselects supported as the left-hand-side (LHS) of IN-predicates.

In other words, is syntax like "... IN (1, 2, 3) ..." supported?

Overrides:
supportsSubselectAsInPredicateLHS in interface Dialect
Returns:
True if subselects can appear as the LHS of an in-predicate; false otherwise.
Since:
3.2

supportsTemporaryTables

public boolean supportsTemporaryTables()
Does this dialect support temporary tables?
Overrides:
supportsTemporaryTables in interface Dialect

supportsVariableLimit

public boolean supportsVariableLimit()
Does this dialect support bind variables (i.e., prepared statememnt parameters) for its limit/offset?
Overrides:
supportsVariableLimit in interface Dialect
Returns:
True if bind variables can be used; false otherwise.

useMaxForLimit

public boolean useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?
Overrides:
useMaxForLimit in interface Dialect