public class

SybaseASE15Dialect

extends Dialect
java.lang.Object
   ↳ org.hibernate.dialect.Dialect
     ↳ org.hibernate.dialect.SybaseASE15Dialect

Class Overview

An SQL dialect targeting Sybase Adaptive Server Enterprise (ASE) 15 and higher.

TODO : verify if this also works with 12/12.5

Summary

[Expand]
Inherited Constants
From class org.hibernate.dialect.Dialect
Public Constructors
SybaseASE15Dialect()
Public Methods
String appendIdentitySelectToInsert(String insertSQL)
Provided we supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.
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.
String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map keyColumnNames)
Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.
boolean areStringComparisonsCaseInsensitive()
By default, Sybase string comparisons are case-insensitive.
boolean doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
boolean doesRepeatableReadCauseReadersToBlockWriters()
For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?
boolean dropTemporaryTableAfterUse()
Do we need to drop the temporary table after use?
String generateTemporaryTableName(String baseTableName)
Generate a temporary table name given the base table.
String getAddColumnString()
The syntax used to add a column to a table (optional).
String getCrossJoinSeparator()
Get the separator to use for defining cross joins when translating HQL queries.
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 timestamp from the database.
String getForUpdateString()
Get the string to append to SELECT statements to acquire locks for this dialect.
String getIdentityColumnString()
The syntax used during DDL to define a column as being an IDENTITY.
String getIdentitySelectString()
Get the select command to use to retrieve the last generated IDENTITY value.
int getMaxAliasLength()
What is the maximum length Hibernate can use for generated aliases?
String getNullColumnString()
The keyword used to specify a nullable column.
ResultSet getResultSet(CallableStatement ps)
Given a callable statement previously processed by registerResultSetOutParameter(CallableStatement, int), extract the ResultSet from the OUT parameter.
String getSelectGUIDString()
Get the command used to select a GUID from the underlying database.
boolean isCurrentTimestampSelectStringCallable()
Should the value returned by getCurrentTimestampSelectString() be treated as callable.
boolean qualifyIndexName()
Do we need to qualify index names with the schema name?
int registerResultSetOutParameter(CallableStatement statement, int col)
Registers an OUT parameter which will be returning a ResultSet.
boolean supportsCascadeDelete()
boolean supportsCurrentTimestampSelection()
Does this dialect support a way to retrieve the database's current timestamp value?
boolean supportsEmptyInList()
Does this dialect support empty IN lists?

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

boolean supportsExistsInSelect()
Does the dialect support an exists statement in the select clause?
boolean supportsExpectedLobUsagePattern()
Actually Sybase does not support LOB locators at al.
boolean supportsIdentityColumns()
Does this dialect support identity column key generation?
boolean supportsInsertSelectIdentity()
Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.
boolean supportsTemporaryTables()
Does this dialect support temporary tables?
boolean supportsTupleDistinctCounts()
Does this dialect support `count(distinct a,b)`?
boolean supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster variant of UNION?
[Expand]
Inherited Methods
From class org.hibernate.dialect.Dialect
From class java.lang.Object

Public Constructors

public SybaseASE15Dialect ()

Public Methods

public String appendIdentitySelectToInsert (String insertSQL)

Provided we supportsInsertSelectIdentity(), then attach the "select identity" clause to the insert statement.

Note, if supportsInsertSelectIdentity() == false then the insert-string should be returned without modification.

Parameters
insertSQL The insert command
Returns
  • The insert command with any necessary identity select clause attached.

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

Parameters
mode The lock mode to apply
tableName The name of the table to which to apply the lock hint.
Returns
  • The table with any required lock hints.

public String applyLocksToSql (String sql, LockOptions aliasedLockOptions, 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.

Parameters
sql the SQL string to modify
aliasedLockOptions lock options indexed by aliased table names.
keyColumnNames a map of key columns indexed by aliased table names.
Returns
  • the modified SQL string.

public boolean areStringComparisonsCaseInsensitive ()

By default, Sybase string comparisons are case-insensitive.

If the DB is configured to be case-sensitive, then this return value will be incorrect.

Returns
  • True if comparisons are case insensitive.

public boolean doesReadCommittedCauseWritersToBlockReaders ()

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?

Returns
  • True if writers block readers to achieve READ_COMMITTED; false otherwise.

public boolean doesRepeatableReadCauseReadersToBlockWriters ()

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?

Returns
  • True if readers block writers to achieve REPEATABLE_READ; false otherwise.

public boolean dropTemporaryTableAfterUse ()

Do we need to drop the temporary table after use?

Returns
  • True if the table should be dropped.

public String generateTemporaryTableName (String baseTableName)

Generate a temporary table name given the base table.

Parameters
baseTableName The table name from which to base the temp table name.
Returns
  • The generated temp table name.

public String getAddColumnString ()

The syntax used to add a column to a table (optional).

Returns
  • The "add column" fragment.

public String getCrossJoinSeparator ()

Get the separator to use for defining cross joins when translating HQL queries.

Typically this will be either [ cross join ] or [, ]

Note that the spaces are important!

public String getCurrentTimestampSQLFunctionName ()

The name of the database-specific SQL function for retrieving the current timestamp.

Returns
  • The function name.

public String getCurrentTimestampSelectString ()

Retrieve the command used to retrieve the current timestamp from the database.

Returns
  • The command.

public String getForUpdateString ()

Get the string to append to SELECT statements to acquire locks for this dialect.

Returns
  • The appropriate FOR UPDATE clause string.

public String getIdentityColumnString ()

The syntax used during DDL to define a column as being an IDENTITY.

Returns
  • The appropriate DDL fragment.

public String getIdentitySelectString ()

Get the select command to use to retrieve the last generated IDENTITY value.

Returns
  • The appropriate select command

public int getMaxAliasLength ()

What is the maximum length Hibernate can use for generated aliases?

Returns
  • The maximum length.

public String getNullColumnString ()

The keyword used to specify a nullable column.

Returns
  • String

public ResultSet getResultSet (CallableStatement ps)

Given a callable statement previously processed by registerResultSetOutParameter(CallableStatement, int), extract the ResultSet from the OUT parameter.

Parameters
ps The callable statement.
Returns
  • The extracted result set.
Throws
SQLException

public String getSelectGUIDString ()

Get the command used to select a GUID from the underlying database.

Optional operation.

Returns
  • The appropriate command.

public boolean isCurrentTimestampSelectStringCallable ()

Should the value returned by getCurrentTimestampSelectString() be treated as callable. Typically this indicates that JDBC escape syntax is being used...

Returns

public boolean qualifyIndexName ()

Do we need to qualify index names with the schema name?

Returns
  • boolean

public int registerResultSetOutParameter (CallableStatement statement, int col)

Registers an OUT parameter which will be returning a ResultSet. How this is accomplished varies greatly from DB to DB, hence its inclusion (along with getResultSet(CallableStatement)) here.

Parameters
statement The callable statement.
col The bind position at which to register the OUT param.
Returns
  • The number of (contiguous) bind positions used.
Throws
SQLException

public boolean supportsCascadeDelete ()

public boolean supportsCurrentTimestampSelection ()

Does this dialect support a way to retrieve the database's current timestamp value?

Returns
  • True if the current timestamp can be retrieved; false otherwise.

public boolean supportsEmptyInList ()

Does this dialect support empty IN lists?

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

Returns
  • True if empty in lists are supported; false otherwise.

public boolean supportsExistsInSelect ()

Does the dialect support an exists statement in the select clause?

Returns
  • True if exists checks are allowed in the select clause; false otherwise.

public boolean supportsExpectedLobUsagePattern ()

Actually Sybase does not support LOB locators at al.

Returns
  • false.

public boolean supportsIdentityColumns ()

Does this dialect support identity column key generation?

Returns
  • True if IDENTITY columns are supported; false otherwise.

public boolean supportsInsertSelectIdentity ()

Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.

Returns
  • True if the dialect supports selecting the just generated IDENTITY in the insert statement.

public boolean supportsTemporaryTables ()

Does this dialect support temporary tables?

Returns
  • True if temp tables are supported; false otherwise.

public boolean supportsTupleDistinctCounts ()

Does this dialect support `count(distinct a,b)`?

Returns
  • True if the database supports counting disintct tuples; false otherwise.

public boolean supportsUnionAll ()

Does this dialect support UNION ALL, which is generally a faster variant of UNION?

Returns
  • True if UNION ALL is supported; false otherwise.