Represents a dialect of SQL implemented by a particular RDBMS.
Subclasses implement Hibernate compatibility with different systems.
Subclasses should provide a public default constructor that register()
a set of type mappings and default Hibernate properties.
Subclasses should be immutable.
appendIdentitySelectToInsert
public String appendIdentitySelectToInsert(String insertString)
insertString
- The insert command
- The insert command with any necessary identity select
clause attached.
appendLockHint
public String appendLockHint(LockMode mode,
String tableName)
Some dialects support an alternative means to
SELECT FOR UPDATE,
whereby a "lock hint" is appends to the table name in the from clause.
contributed by
Helge Schulz
mode
- The lock mode to applytableName
- The name of the table to which to apply the lock hint.
- The table with any required lock hints.
applyLocksToSql
public String applyLocksToSql(String sql,
Map aliasedLockModes,
Map keyColumnNames)
Modifies the given SQL by applying the appropriate updates for the specified
lock modes and key columns.
The behavior here is that of an ANSI SQL
SELECT FOR UPDATE. This
method is really intended to allow dialects which do not support
SELECT FOR UPDATE to achieve this in their own fashion.
sql
- the SQL string to modifyaliasedLockModes
- a map of lock modes indexed by aliased table names.keyColumnNames
- a map of key columns indexed by aliased table names.
areStringComparisonsCaseInsensitive
public boolean areStringComparisonsCaseInsensitive()
Are string comparisons implicitly case insensitive.
In other words, does [where 'XYZ' = 'xyz'] resolve to true?
- True if comparisons are case insensitive.
bindLimitParametersFirst
public boolean bindLimitParametersFirst()
Does the LIMIT clause come at the start of the
SELECT statement, rather than at the end?
- true if limit parameters should come before other parameters
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
Does this dialect require us to bind the parameters in reverse order?
- true if the correct order is limit, offset
buildSQLExceptionConverter
public SQLExceptionConverter buildSQLExceptionConverter()
Build an instance of the SQLExceptionConverter preferred by this dialect for
converting SQLExceptions into Hibernate's JDBCException hierarchy. The default
Dialect implementation simply returns a converter based on X/Open SQLState codes.
It is strongly recommended that specific Dialect implementations override this
method, since interpretation of a SQL error is much more accurate when based on
the ErrorCode rather than the SQLState. Unfortunately, the ErrorCode is a vendor-
specific approach.
- The Dialect's preferred SQLExceptionConverter.
closeQuote
public char closeQuote()
The character specific to this dialect used to close a quoted identifier.
- The dialect's specific close quote character.
createCaseFragment
public CaseFragment createCaseFragment()
Create a
CaseFragment
strategy responsible
for handling this dialect's variations in how CASE statements are
handled.
createOuterJoinFragment
public JoinFragment createOuterJoinFragment()
Create a
JoinFragment
strategy responsible
for handling this dialect's variations in how joins are handled.
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by
forcing readers to wait for write locks to be released?
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
doesRepeatableReadCauseReadersToBlockWriters
public boolean doesRepeatableReadCauseReadersToBlockWriters()
For the underlying database, is REPEATABLE_READ isolation implemented by
forcing writers to wait for read locks to be released?
- True if readers block writers to achieve REPEATABLE_READ; false otherwise.
dropConstraints
public boolean dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
- True if constraints must be dropped prior to dropping
the table; false otherwise.
dropTemporaryTableAfterUse
public boolean dropTemporaryTableAfterUse()
Do we need to drop the temporary table after use?
- True if the table should be dropped.
forUpdateOfColumns
public boolean forUpdateOfColumns()
Is FOR UPDATE OF syntax supported?
- True if the database supports FOR UPDATE OF syntax;
false otherwise.
generateTemporaryTableName
public String generateTemporaryTableName(String baseTableName)
Generate a temporary table name given the bas table.
baseTableName
- The table name from which to base the temp table name.
- The generated temp table name.
getAddColumnString
public String getAddColumnString()
The syntax used to add a column to a table (optional).
- The "add column" fragment.
getAddForeignKeyConstraintString
public String getAddForeignKeyConstraintString(String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey,
boolean referencesPrimaryKey)
The syntax used to add a foreign key constraint to a table.
constraintName
- The FK constraint name.foreignKey
- The names of the columns comprising the FKreferencedTable
- The table referenced by the FKprimaryKey
- The explicit columns in the referencedTable referenced
by this FK.referencesPrimaryKey
- if false, constraint should be
explicit about which column names the constraint refers to
getAddPrimaryKeyConstraintString
public String getAddPrimaryKeyConstraintString(String constraintName)
The syntax used to add a primary key constraint to a table.
constraintName
- The name of the PK constraint.
getCascadeConstraintsString
public String getCascadeConstraintsString()
Completely optional cascading drop clause
getCastTypeName
public String getCastTypeName(int code)
Get the name of the database type appropriate for casting operations
(via the CAST() SQL function) for the given java.sql.Types
typecode.
code
- The java.sql.Types
typecode
getColumnComment
public String getColumnComment(String comment)
getCreateMultisetTableString
public String getCreateMultisetTableString()
Slight variation on
getCreateTableString()
. Here, we have the
command used to create a table when there is no primary key and
duplicate rows are expected.
Most databases do not care about the distinction; originally added for
Teradata support which does care.
- The command used to create a multiset table.
getCreateSequenceString
protected String getCreateSequenceString(String sequenceName)
throws MappingException
Typically dialects which support sequences can create a sequence
with a single command. This is convenience form of
getCreateSequenceStrings
to help facilitate that.
Dialects which support sequences and can create a sequence in a
single command need *only* override this method. Dialects
which support sequences but require multiple commands to create
a sequence should instead override
getCreateSequenceStrings
.
sequenceName
- The name of the sequence
- The sequence creation command
getCreateSequenceString
protected String getCreateSequenceString(String sequenceName,
int initialValue,
int incrementSize)
throws MappingException
Overloaded form of
getCreateSequenceString(String)
, additionally
taking the initial value and increment size to be applied to the sequence
definition.
The default definition is to suffix
getCreateSequenceString(String)
with the string: " start with {initialValue} increment by {incrementSize}" where
{initialValue} and {incrementSize} are replacement placeholders. Generally
dialects should only need to override this method if different key phrases
are used to apply the allocation information.
sequenceName
- The name of the sequenceinitialValue
- The initial value to apply to 'create sequence' statementincrementSize
- The increment value to apply to 'create sequence' statement
- The sequence creation command
getCreateSequenceStrings
public String[] getCreateSequenceStrings(String sequenceName)
throws MappingException
Use getCreateSequenceString(String,int,int)
instead
The multiline script used to create a sequence.
sequenceName
- The name of the sequence
- The sequence creation commands
getCreateSequenceStrings
public String[] getCreateSequenceStrings(String sequenceName,
int initialValue,
int incrementSize)
throws MappingException
sequenceName
- The name of the sequenceinitialValue
- The initial value to apply to 'create sequence' statementincrementSize
- The increment value to apply to 'create sequence' statement
- The sequence creation commands
getCreateTableString
public String getCreateTableString()
Command used to create a table.
- The command used to create a table.
getCreateTemporaryTablePostfix
public String getCreateTemporaryTablePostfix()
Get any fragments needing to be postfixed to the command for
temporary table creation.
getCreateTemporaryTableString
public String getCreateTemporaryTableString()
Command used to create a temporary table.
- The command used to create a temporary table.
getCurrentTimestampSQLFunctionName
public String getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the
current timestamp.
getCurrentTimestampSelectString
public String getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the
database.
getDefaultProperties
public final Properties getDefaultProperties()
Retrieve a set of default Hibernate properties for this database.
- a set of Hibernate properties
getDialect
public static Dialect getDialect()
throws HibernateException
Get an instance of the dialect specified by the current System properties.
getDialect
public static Dialect getDialect(Properties props)
throws HibernateException
Get an instance of the dialect specified by the given properties or by
the current System properties.
props
- The properties to use for finding the dialect class to use.
getDropForeignKeyString
public String getDropForeignKeyString()
getDropSequenceString
protected String getDropSequenceString(String sequenceName)
throws MappingException
Typically dialects which support sequences can drop a sequence
with a single command. This is convenience form of
getDropSequenceStrings(String)
to help facilitate that.
Dialects which support sequences and can drop a sequence in a
single command need *only* override this method. Dialects
which support sequences but require multiple commands to drop
a sequence should instead override
getDropSequenceStrings(String)
.
sequenceName
- The name of the sequence
- The sequence drop commands
getDropSequenceStrings
public String[] getDropSequenceStrings(String sequenceName)
throws MappingException
The multiline script used to drop a sequence.
sequenceName
- The name of the sequence
- The sequence drop commands
getForUpdateNowaitString
public String getForUpdateNowaitString()
Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
- The appropriate FOR UPDATE NOWAIT clause string.
getForUpdateNowaitString
public String getForUpdateNowaitString(String aliases)
Get the FOR UPDATE OF column_list NOWAIT fragment appropriate
for this dialect given the aliases of the columns to be write locked.
aliases
- The columns to be write locked.
- The appropriate FOR UPDATE colunm_list NOWAIT clause string.
getForUpdateString
public String getForUpdateString()
Get the string to append to SELECT statements to acquire locks
for this dialect.
- The appropriate FOR UPDATE clause string.
getForUpdateString
public String getForUpdateString(String aliases)
Get the FOR UPDATE OF column_list fragment appropriate for this
dialect given the aliases of the columns to be write locked.
aliases
- The columns to be write locked.
- The appropriate FOR UPDATE OF column_list clause string.
getForUpdateString
public String getForUpdateString(LockMode lockMode)
Given a lock mode, determine the appropriate for update fragment to use.
lockMode
- The lock mode to apply.
- The appropriate for update fragment.
getFunctions
public final Map getFunctions()
Retrieves a map of the dialect's registered fucntions
(functionName =>
SQLFunction
).
- The map of registered functions.
getHibernateTypeName
public String getHibernateTypeName(int code)
throws HibernateException
Get the name of the Hibernate
Type
associated with th given
java.sql.Types
typecode.
code
- The java.sql.Types
typecode
getHibernateTypeName
public String getHibernateTypeName(int code,
int length,
int precision,
int scale)
throws HibernateException
Get the name of the Hibernate
Type
associated
with the given
java.sql.Types
typecode with the given storage
specification parameters.
code
- The java.sql.Types
typecodelength
- The datatype lengthprecision
- The datatype precisionscale
- The datatype scale
getIdentityColumnString
protected String getIdentityColumnString()
throws MappingException
The syntax used during DDL to define a column as being an IDENTITY.
- The appropriate DDL fragment.
getIdentityColumnString
public String getIdentityColumnString(int type)
throws MappingException
The syntax used during DDL to define a column as being an IDENTITY of
a particular type.
type
- The java.sql.Types
type code.
- The appropriate DDL fragment.
getIdentityInsertString
public String getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null).
Need if the dialect does not support inserts that specify no column values.
getIdentitySelectString
protected String getIdentitySelectString()
throws MappingException
Get the select command to use to retrieve the last generated IDENTITY
value.
- The appropriate select command
getIdentitySelectString
public String getIdentitySelectString(String table,
String column,
int type)
throws MappingException
Get the select command to use to retrieve the last generated IDENTITY
value for a particuar table
table
- The table into which the insert was donecolumn
- The PK column.type
- The java.sql.Types
type code.
- The appropriate select command
getKeywords
public Set getKeywords()
getLimitString
protected String getLimitString(String query,
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
getLimitString(String,int,int)
.
query
- The query to which to apply the limit.hasOffset
- Is the query requesting an offset?
getLimitString
public String getLimitString(String query,
int offset,
int limit)
Given a limit and an offset, apply the limit clause to the query.
query
- The query to which to apply the limit.offset
- The offset of the limitlimit
- The limit of the limit ;)
- The modified query statement with the limit applied.
getLockingStrategy
public LockingStrategy getLockingStrategy(Lockable lockable,
LockMode lockMode)
Get a strategy instance which knows how to acquire a database-level lock
of the specified mode for this dialect.
lockable
- The persister for the entity to be locked.lockMode
- The type of lock to be acquired.
- The appropriate locking strategy.
getLowercaseFunction
public String getLowercaseFunction()
The name of the SQL function that transforms a string to
lowercase
- The dialect-specific lowercase function.
getMaxAliasLength
public int getMaxAliasLength()
What is the maximum length Hibernate can use for generated aliases?
getNativeIdentifierGeneratorClass
public Class getNativeIdentifierGeneratorClass()
The class (which implements
IdentifierGenerator
)
which acts as this dialects native generation strategy.
Comes into play whenever the user specifies the native generator.
- The native generator class.
getNoColumnsInsertString
public String getNoColumnsInsertString()
The fragment used to insert a row without specifying any column values.
This is not possible on some databases.
- The appropriate empty values clause.
getNullColumnString
public String getNullColumnString()
The keyword used to specify a nullable column.
getQuerySequencesString
public String getQuerySequencesString()
Get the select command used retrieve the names of all sequences.
- The select command; or null if sequences are not supported.
getResultSet
public ResultSet getResultSet(CallableStatement statement)
throws SQLException
statement
- The callable statement.
- The extracted result set.
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.
sqlType
- The java.sql.Types
type code.
- The appropriate select clause value fragment.
getSelectGUIDString
public String getSelectGUIDString()
Get the command used to select a GUID from the underlying database.
Optional operation.
getSelectSequenceNextValString
public String getSelectSequenceNextValString(String sequenceName)
throws MappingException
Generate the select expression fragment that will retreive the next
value of a sequence as part of another (typically DML) statement.
This differs from
getSequenceNextValString(String)
in that this
should return an expression usable within another statement.
sequenceName
- the name of the sequence
getSequenceNextValString
public String getSequenceNextValString(String sequenceName)
throws MappingException
Generate the appropriate select statement to to retreive the next value
of a sequence.
This should be a "stand alone" select statement.
sequenceName
- the name of the sequence
- String The "nextval" select string.
getTableComment
public String getTableComment(String comment)
getTableTypeString
public String getTableTypeString()
getTypeName
public String getTypeName(int code)
throws HibernateException
Get the name of the database type associated with the given
java.sql.Types
typecode.
code
- The java.sql.Types
typecode
getTypeName
public String getTypeName(int code,
int length,
int precision,
int scale)
throws HibernateException
Get the name of the database type associated with the given
java.sql.Types
typecode with the given storage specification
parameters.
code
- The java.sql.Types
typecodelength
- The datatype lengthprecision
- The datatype precisionscale
- The datatype scale
hasAlterTable
public boolean hasAlterTable()
Does this dialect support the ALTER TABLE syntax?
- True if we support altering of tables; false otherwise.
hasDataTypeInIdentityColumn
public boolean hasDataTypeInIdentityColumn()
Whether this dialect have an Identity clause added to the data type or a
completely seperate identity data type
hasSelfReferentialForeignKeyBug
public boolean hasSelfReferentialForeignKeyBug()
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
openQuote
public char openQuote()
The character specific to this dialect used to begin a quoted identifier.
- The dialect's specific open quote character.
performTemporaryTableDDLInIsolation
public Boolean performTemporaryTableDDLInIsolation()
Does the dialect require that temporary table DDL statements occur in
isolation from other statements? This would be the case if the creation
would cause any current transaction to get committed implicitly.
JDBC defines a standard way to query for this information via the
java.sql.DatabaseMetaData.dataDefinitionCausesTransactionCommit()
method. However, that does not distinguish between temporary table
DDL and other forms of DDL; MySQL, for example, reports DDL causing a
transaction commit via its driver, even though that is not the case for
temporary table DDL.
Possible return values and their meanings:
Boolean.TRUE
- Unequivocally, perform the temporary table DDL
in isolation.Boolean.FALSE
- Unequivocally, do not perform the
temporary table DDL in isolation.- null - defer to the JDBC driver response in regards to
java.sql.DatabaseMetaData.dataDefinitionCausesTransactionCommit()
- see the result matrix above.
qualifyIndexName
public boolean qualifyIndexName()
Do we need to qualify index names with the schema name?
quote
public final String quote(String column)
Apply dialect-specific quoting.
By default, the incoming value is checked to see if its first character
is the back-tick (`). If so, the dialect specific quoting is applied.
column
- The value to be quoted.
- The quoted (or unmodified, if not starting with back-tick) value.
registerColumnType
protected void registerColumnType(int code,
String name)
Subclasses register a type name for the given type code. $l in
the type name with be replaced by the column length (if appropriate).
code
- The java.sql.Types
typecodename
- The database type name
registerColumnType
protected void registerColumnType(int code,
int capacity,
String name)
Subclasses register a type name for the given type code and maximum
column length. $l in the type name with be replaced by the
column length (if appropriate).
code
- The java.sql.Types
typecodecapacity
- The maximum length of database typename
- The database type name
registerFunction
protected void registerFunction(String name,
SQLFunction function)
registerHibernateType
protected void registerHibernateType(int code,
String name)
Registers a Hibernate
Type
name for the given
java.sql.Types
type code.
code
- The java.sql.Types
typecodename
- The Hibernate Type
name
registerHibernateType
protected void registerHibernateType(int code,
int capacity,
String name)
Registers a Hibernate
Type
name for the given
java.sql.Types
type code and maximum column length.
code
- The java.sql.Types
typecodecapacity
- The maximum length of database typename
- The Hibernate Type
name
registerKeyword
protected void registerKeyword(String word)
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement,
int position)
throws SQLException
Registers an OUT parameter which will be returing a
java.sql.ResultSet
. How this is accomplished varies greatly
from DB to DB, hence its inclusion (along with
getResultSet(CallableStatement)
) here.
statement
- The callable statement.position
- The bind position at which to register the OUT param.
- The number of (contiguous) bind positions used.
supportsBindAsCallableArgument
public boolean supportsBindAsCallableArgument()
Does this dialect support using a JDBC bind parameter as an argument
to a function or procedure call?
- True if the database supports accepting bind params as args; false otherwise.
supportsCascadeDelete
public boolean supportsCascadeDelete()
supportsCircularCascadeDeleteConstraints
public boolean supportsCircularCascadeDeleteConstraints()
Does this dialect support definition of cascade delete constraints
which can cause circular chains?
- True if circular cascade delete constraints are supported; false
otherwise.
supportsColumnCheck
public boolean supportsColumnCheck()
Does this dialect support column-level check constraints?
- True if column-level CHECK constraints are supported; false
otherwise.
supportsCommentOn
public boolean supportsCommentOn()
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Does this dialect support a way to retrieve the database's current
timestamp value?
- True if the current timestamp can be retrieved; false otherwise.
supportsEmptyInList
public boolean supportsEmptyInList()
Does this dialect support empty IN lists?
For example, is [where XYZ in ()] a supported construct?
- True if empty in lists are supported; false otherwise.
supportsExistsInSelect
public boolean supportsExistsInSelect()
Does the dialect support an exists statement in the select clause?
- True if exists checks are allowed in the select clause; false otherwise.
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...
- True if normal LOB usage patterns can be used with this driver;
false if driver-specific hookiness needs to be applied.
supportsIdentityColumns
public boolean supportsIdentityColumns()
Does this dialect support identity column key generation?
- True if IDENTITY columns are supported; false otherwise.
supportsIfExistsAfterTableName
public boolean supportsIfExistsAfterTableName()
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()
supportsInsertSelectIdentity
public boolean supportsInsertSelectIdentity()
Does the dialect support some form of inserting and selecting
the generated IDENTITY value all in the same statement.
- True if the dialect supports selecting the just
generated IDENTITY in the insert statement.
supportsLimit
public boolean supportsLimit()
Does this dialect support some form of limiting query results
via a SQL clause?
- True if this dialect supports some form of LIMIT.
supportsLimitOffset
public boolean supportsLimitOffset()
Does this dialect's LIMIT support (if any) additionally
support specifying an offset?
- True if the dialect supports an offset within the limit support.
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Does the dialect support propogating changes to LOB
values back to the database? Talking about mutating the
internal value of the locator as opposed to supplying a new
locator instance...
For BLOBs, the internal value might be changed by:
java.sql.Blob.setBinaryStream
,
java.sql.Blob.setBytes(long, byte[])
,
java.sql.Blob.setBytes(long, byte[], int, int)
,
or
java.sql.Blob.truncate(long)
.
For CLOBs, the internal value might be changed by:
java.sql.Clob.setAsciiStream(long)
,
java.sql.Clob.setCharacterStream(long)
,
java.sql.Clob.setString(long, String)
,
java.sql.Clob.setString(long, String, int, int)
,
or
java.sql.Clob.truncate(long)
.
NOTE : I do not know the correct answer currently for
databases which (1) are not part of the cruise control process
or (2) do not
supportsExpectedLobUsagePattern()
.
- True if the changes are propogated back to the
database; false otherwise.
supportsNotNullUnique
public boolean supportsNotNullUnique()
supportsOuterJoinForUpdate
public boolean supportsOuterJoinForUpdate()
Does this dialect support FOR UPDATE in conjunction with
outer joined rows?
- True if outer joined rows can be locked via FOR UPDATE.
supportsParametersInInsertSelect
public boolean supportsParametersInInsertSelect()
Does this dialect support parameters within the select clause of
INSERT ... SELECT ... statements?
- True if this is supported; false otherwise.
supportsPooledSequences
public boolean supportsPooledSequences()
Does this dialect support "pooled" sequences. Not aware of a better
name for this. Essentially can we specify the initial and increment values?
- True if such "pooled" sequences are supported; false otherwise.
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
Does this dialect support asking the result set its positioning
information on forward only cursors. Specifically, in the case of
scrolling fetches, Hibernate needs to use
java.sql.ResultSet.isAfterLast
and
java.sql.ResultSet.isBeforeFirst
. Certain drivers do not
allow access to these methods for forward only cursors.
NOTE : this is highly driver dependent!
- True if methods like
java.sql.ResultSet.isAfterLast
and
java.sql.ResultSet.isBeforeFirst
are supported for forward
only cursors; false otherwise.
supportsRowValueConstructorSyntax
public boolean supportsRowValueConstructorSyntax()
Is this dialect known to support what ANSI-SQL terms "row value
constructor" syntax; sometimes called tuple syntax.
Basically, does it support syntax like
"... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".
- True if this SQL dialect is known to support "row value
constructor" syntax; false otherwise.
supportsRowValueConstructorSyntaxInInList
public boolean supportsRowValueConstructorSyntaxInInList()
If the dialect supports
row values
,
does it offer such support in IN lists as well?
For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."
- True if this SQL dialect is known to support "row value
constructor" syntax in the IN list; false otherwise.
supportsSequences
public boolean supportsSequences()
Does this dialect support sequences?
- True if sequences supported; false otherwise.
supportsSubqueryOnMutatingTable
public boolean supportsSubqueryOnMutatingTable()
Does this dialect support referencing the table being mutated in
a subquery. The "table being mutated" is the table referenced in
an UPDATE or a DELETE query. And so can that table then be
referenced in a subquery of said UPDATE/DELETE query.
For example, would the following two syntaxes be supported:
- delete from TABLE_A where ID not in ( select ID from TABLE_A )
- update TABLE_A set NON_ID = 'something' where ID in ( select ID from TABLE_A)
- True if this dialect allows references the mutating table from
a subquery.
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?
- True if subselects can appear as the LHS of an in-predicate;
false otherwise.
supportsTableCheck
public boolean supportsTableCheck()
Does this dialect support table-level check constraints?
- True if table-level CHECK constraints are supported; false
otherwise.
supportsTemporaryTables
public boolean supportsTemporaryTables()
Does this dialect support temporary tables?
- True if temp tables are supported; false otherwise.
supportsUnboundedLobLocatorMaterialization
public boolean supportsUnboundedLobLocatorMaterialization()
Is it supported to materialize a LOB locator outside the transaction in
which it was created?
Again, part of the trickiness here is the fact that this is largely
driver dependent.
NOTE: all database I have tested which
supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction...
- True if unbounded materialization is supported; false otherwise.
supportsUnionAll
public boolean supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster
variant of UNION?
- True if UNION ALL is supported; false otherwise.
supportsUnique
public boolean supportsUnique()
Does this dialect support the UNIQUE column syntax?
supportsUniqueConstraintInCreateAlterTable
public boolean supportsUniqueConstraintInCreateAlterTable()
Does this dialect support adding Unique constraints via create and alter table ?
supportsVariableLimit
public boolean supportsVariableLimit()
Does this dialect support bind variables (i.e., prepared statememnt
parameters) for its limit/offset?
- True if bind variables can be used; false otherwise.
toBooleanValueString
public String toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
- The appropriate SQL literal.
toString
public String toString()
transformSelectString
public String transformSelectString(String select)
Meant as a means for end users to affect the select strings being sent
to the database and perhaps manipulate them in some fashion.
The recommend approach is to instead use
Interceptor.onPrepareStatement(String)
.
select
- The select command
- The mutated select command, or the same as was passed in.
useInputStreamToInsertBlob
public boolean useInputStreamToInsertBlob()
Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e.
java.sql.PreparedStatement.setBinaryStream
).
- True if BLOBs and CLOBs should be bound using stream operations.
useMaxForLimit
public boolean useMaxForLimit()
Does the
LIMIT clause take a "maximum" row number instead
of a total number of returned rows?
This is easiest understood via an example. Consider you have a table
with 20 rows, but you only want to retrieve rows number 11 through 20.
Generally, a limit with offset would say that the offset = 11 and the
limit = 10 (we only want 10 rows at a time); this is specifying the
total number of returned rows. Some dialects require that we instead
specify offset = 11 and limit = 20, where 20 is the "last" row we want
relative to offset (i.e. total number of rows = 20 - 11 = 9)
So essentially, is limit relative from offset? Or is limit absolute?
- True if limit is relative from offset; false otherwise.