Top Description Fields Constructors Methods
org.hibernate.dialect

public Class SybaseASE157Dialect

extends SybaseASE15Dialect
Class Inheritance
Imports
java.sql.SQLException, java.util.Map, org.hibernate.JDBCException, .LockOptions, org.hibernate.dialect.function.SQLFunctionTemplate, org.hibernate.dialect.pagination.LimitHandler, .SybaseASE157LimitHandler, org.hibernate.exception.ConstraintViolationException, .LockTimeoutException, org.hibernate.exception.spi.SQLExceptionConversionDelegate, org.hibernate.internal.util.JdbcExceptionHelper, org.hibernate.sql.ForUpdateFragment, org.hibernate.type.StandardBasicTypes

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

Author
Junyan Ren

Field Summary

Modifier and TypeField and Description
private static final SybaseASE157LimitHandler

Constructor Summary

AccessConstructor and Description
public
SybaseASE157Dialect()

Constructs a SybaseASE157Dialect

Method Summary

Modifier and TypeMethod and Description
public String
appendLockHint(LockOptions
The lock options to apply
mode
,
String
The name of the table to which to apply the lock hint.
tableName
)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.appendLockHint.

Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.
public String
applyLocksToSql(String
the SQL string to modify
sql
,
LockOptions
lock options indexed by aliased table names.
aliasedLockOptions
,
Map<String, String[]>
a map of key columns indexed by aliased table names.
keyColumnNames
)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.applyLocksToSql.

Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.
public SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()

Overrides org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.
public boolean
forUpdateOfColumns()

Overrides org.hibernate.dialect.Dialect.forUpdateOfColumns.

Is FOR UPDATE OF syntax supported?
public String
getForUpdateString()

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public String
getForUpdateString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
public LimitHandler
getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.
public String
public boolean
public boolean
supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?
public boolean
supportsLimitOffset()

Overrides org.hibernate.dialect.Dialect.supportsLimitOffset.

Does this dialect's LIMIT support (if any) additionally support specifying an offset?
public boolean
supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
Inherited from org.hibernate.dialect.SybaseASE15Dialect:
areStringComparisonsCaseInsensitivegetCrossJoinSeparatorgetCurrentTimestampSQLFunctionNamegetMaxAliasLengthgetNameQualifierSupportgetSqlTypeDescriptorOverridesupportsCascadeDeletesupportsLockTimeoutssupportsPartitionBy

Field Detail

LIMIT_HANDLERback to summary
private static final SybaseASE157LimitHandler LIMIT_HANDLER

Constructor Detail

SybaseASE157Dialectback to summary
public SybaseASE157Dialect()

Constructs a SybaseASE157Dialect

Method Detail

appendLockHintback to summary
public String appendLockHint(LockOptions mode, String tableName)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.appendLockHint.

Doc from org.hibernate.dialect.Dialect.appendLockHint.

Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.

contributed by Helge Schulz

Parameters
mode:LockOptions

The lock options to apply

tableName:String

The name of the table to which to apply the lock hint.

Returns:String

The table with any required lock hints.

Annotations
@Override
applyLocksToSqlback to summary
public String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map<String, String[]> keyColumnNames)

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.applyLocksToSql.

Doc from org.hibernate.dialect.Dialect.applyLocksToSql.

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:String

the SQL string to modify

aliasedLockOptions:LockOptions

lock options indexed by aliased table names.

keyColumnNames:Map<String, String[]>

a map of key columns indexed by aliased table names.

Returns:String

the modified SQL string.

Annotations
@Override
buildSQLExceptionConversionDelegateback to summary
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()

Overrides org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Doc from org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

When buildSQLExceptionConverter returns null, the default SQLExceptionConverter is used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the default SQLExceptionConverter will use the returned SQLExceptionConversionDelegate in addition to the following standard delegates:

  1. a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
  2. a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType

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 vendor-specific ErrorCode rather than the SQLState.

Specific Dialects may override to return whatever is most appropriate for that vendor.

Returns:SQLExceptionConversionDelegate

The SQLExceptionConversionDelegate for this dialect

Annotations
@Override
forUpdateOfColumnsback to summary
public boolean forUpdateOfColumns()

Overrides org.hibernate.dialect.Dialect.forUpdateOfColumns.

Doc from org.hibernate.dialect.Dialect.forUpdateOfColumns.

Is FOR UPDATE OF syntax supported?

Returns:boolean

True if the database supports FOR UPDATE OF syntax; false otherwise.

Annotations
@Override
getForUpdateStringback to summary
public String getForUpdateString()

Overrides org.hibernate.dialect.AbstractTransactSQLDialect.getForUpdateString.

Doc from org.hibernate.dialect.Dialect.getForUpdateString.

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

Returns:String

The appropriate FOR UPDATE clause string.

Annotations
@Override
getForUpdateStringback to summary
public String getForUpdateString(String aliases)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Doc from org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.

Parameters
aliases:String

The columns to be write locked.

Returns:String

The appropriate FOR UPDATE OF column_list clause string.

Annotations
@Override
getLimitHandlerback to summary
public LimitHandler getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Doc from org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.

Returns:LimitHandler

LIMIT clause delegate.

Annotations
@Override
getTableTypeStringback to summary
public String getTableTypeString()

Overrides org.hibernate.dialect.Dialect.getTableTypeString.

Annotations
@Override
supportsExpectedLobUsagePatternback to summary
public boolean supportsExpectedLobUsagePattern()

Overrides org.hibernate.dialect.SybaseASE15Dialect.supportsExpectedLobUsagePattern.

Doc from org.hibernate.dialect.SybaseASE15Dialect.supportsExpectedLobUsagePattern.

Actually Sybase does not support LOB locators at al.

Returns:boolean

false.

True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.

Annotations
@Override
supportsLimitback to summary
public boolean supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Doc from org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?

Returns:boolean

True if this dialect supports some form of LIMIT.

Annotations
@Override
supportsLimitOffsetback to summary
public boolean supportsLimitOffset()

Overrides org.hibernate.dialect.Dialect.supportsLimitOffset.

Doc from org.hibernate.dialect.Dialect.supportsLimitOffset.

Does this dialect's LIMIT support (if any) additionally support specifying an offset?

Returns:boolean

True if the dialect supports an offset within the limit support.

Annotations
@Override
supportsLobValueChangePropogationback to summary
public boolean supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Doc from org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating 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: Blob#setBinaryStream, Blob#setBytes(long, byte[]), Blob#setBytes(long, byte[], int, int), or Blob#truncate(long).

For CLOBs, the internal value might be changed by: Clob#setAsciiStream(long), Clob#setCharacterStream(long), Clob#setString(long, String), Clob#setString(long, String, int, int), or 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.

Returns:boolean

True if the changes are propagated back to the database; false otherwise.

Annotations
@Override