public class

DB2390Dialect

extends DB2Dialect
java.lang.Object
   ↳ org.hibernate.dialect.Dialect
     ↳ org.hibernate.dialect.DB2Dialect
       ↳ org.hibernate.dialect.DB2390Dialect

Class Overview

An SQL dialect for DB2/390. This class provides support for DB2 Universal Database for OS/390, also known as DB2/390.

Summary

[Expand]
Inherited Constants
From class org.hibernate.dialect.Dialect
Public Constructors
DB2390Dialect()
Public Methods
String getIdentitySelectString()
Get the select command to use to retrieve the last generated IDENTITY value.
String getLimitString(String sql, int offset, int limit)
Given a limit and an offset, apply the limit clause to the query.
boolean supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause?
boolean supportsLimitOffset()
Does this dialect's LIMIT support (if any) additionally support specifying an offset?
boolean supportsSequences()
Does this dialect support sequences?
boolean supportsVariableLimit()
Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
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.

[Expand]
Inherited Methods
From class org.hibernate.dialect.DB2Dialect
From class org.hibernate.dialect.Dialect
From class java.lang.Object

Public Constructors

public DB2390Dialect ()

Public Methods

public String getIdentitySelectString ()

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

Returns
  • The appropriate select command

public String getLimitString (String sql, int offset, int limit)

Given a limit and an offset, apply the limit clause to the query.

Parameters
sql The query to which to apply the limit.
offset The offset of the limit
limit The limit of the limit ;)
Returns
  • The modified query statement with the limit applied.

public boolean supportsLimit ()

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

Returns
  • True if this dialect supports some form of LIMIT.

public boolean supportsLimitOffset ()

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

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

public boolean supportsSequences ()

Does this dialect support sequences?

Returns
  • True if sequences supported; false otherwise.

public boolean supportsVariableLimit ()

Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?

Returns
  • True if bind variables can be used; false otherwise.

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?

Returns
  • True if limit is relative from offset; false otherwise.