|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.dialect.Dialect org.hibernate.dialect.DB2Dialect
An SQL dialect for DB2.
Field Summary |
Fields inherited from class org.hibernate.dialect.Dialect |
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE |
Constructor Summary | |
DB2Dialect()
|
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)
Typically dialects which support sequences can create a sequence with a single command. |
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 |
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the database. |
String |
getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the current timestamp. |
String |
getDropSequenceString(String sequenceName)
Typically dialects which support sequences can drop a sequence with a single command. |
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 |
getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null). |
String |
getIdentitySelectString()
Get the select command to use to retrieve the last generated IDENTITY value. |
String |
getLimitString(String sql,
boolean hasOffset)
Apply s limit clause to the query. |
String |
getLowercaseFunction()
The name of the SQL function that transforms a string to lowercase |
String |
getQuerySequencesString()
Get the select command used retrieve the names of all sequences. |
ResultSet |
getResultSet(CallableStatement ps)
Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int) ,
extract the ResultSet from the OUT parameter. |
String |
getSelectClauseNullString(int sqlType)
Given a Types type code, determine an appropriate
null value to use in a select clause. |
String |
getSequenceNextValString(String sequenceName)
Generate the appropriate select statement to to retreive the next value of a sequence. |
boolean |
isCurrentTimestampSelectStringCallable()
Should the value returned by getCurrentTimestampSelectString()
be treated as callable. |
static void |
main(String[] args)
|
int |
registerResultSetOutParameter(CallableStatement statement,
int col)
Registers an OUT parameter which will be returing a ResultSet . |
boolean |
supportsCommentOn()
|
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 |
supportsIdentityColumns()
Does this dialect support identity column key generation? |
boolean |
supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause? |
boolean |
supportsNotNullUnique()
|
boolean |
supportsOuterJoinForUpdate()
Does this dialect support FOR UPDATE in conjunction with outer joined rows? |
boolean |
supportsParametersInInsertSelect()
Does this dialect support parameters within the select clause of INSERT ... |
boolean |
supportsSequences()
Does this dialect support sequences? |
boolean |
supportsTemporaryTables()
Does this dialect support temporary tables? |
boolean |
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster variant of UNION? |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DB2Dialect()
Method Detail |
public String getLowercaseFunction()
Dialect
getLowercaseFunction
in class Dialect
public String getAddColumnString()
Dialect
getAddColumnString
in class Dialect
public boolean dropConstraints()
Dialect
dropConstraints
in class Dialect
public boolean supportsIdentityColumns()
Dialect
supportsIdentityColumns
in class Dialect
public String getIdentitySelectString()
Dialect
getIdentitySelectString
in class Dialect
public String getIdentityColumnString()
Dialect
getIdentityColumnString
in class Dialect
public String getIdentityInsertString()
Dialect
getIdentityInsertString
in class Dialect
public String getSequenceNextValString(String sequenceName)
Dialect
getSequenceNextValString
in class Dialect
sequenceName
- the name of the sequence
public String getCreateSequenceString(String sequenceName)
Dialect
Dialect.getCreateSequenceStrings(java.lang.String)
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 Dialect.getCreateSequenceStrings(java.lang.String)
.
getCreateSequenceString
in class Dialect
sequenceName
- The name of the sequence
public String getDropSequenceString(String sequenceName)
Dialect
Dialect.getDropSequenceStrings(java.lang.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 Dialect.getDropSequenceStrings(java.lang.String)
.
getDropSequenceString
in class Dialect
sequenceName
- The name of the sequence
public boolean supportsSequences()
Dialect
supportsSequences
in class Dialect
public String getQuerySequencesString()
Dialect
getQuerySequencesString
in class Dialect
SchemaUpdate
public boolean supportsLimit()
Dialect
supportsLimit
in class Dialect
public String getLimitString(String sql, boolean hasOffset)
Dialect
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
Dialect.getLimitString(String, int, int)
.
getLimitString
in class Dialect
sql
- The query to which to apply the limit.hasOffset
- Is the query requesting an offset?
public String getForUpdateString()
Dialect
getForUpdateString
in class Dialect
public boolean useMaxForLimit()
Dialect
useMaxForLimit
in class Dialect
public boolean supportsOuterJoinForUpdate()
Dialect
supportsOuterJoinForUpdate
in class Dialect
public boolean supportsNotNullUnique()
supportsNotNullUnique
in class Dialect
public String getSelectClauseNullString(int sqlType)
Dialect
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.
getSelectClauseNullString
in class Dialect
sqlType
- The Types
type code.
public static void main(String[] args)
public boolean supportsUnionAll()
Dialect
supportsUnionAll
in class Dialect
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
Dialect
ResultSet
. How this is accomplished varies greatly
from DB to DB, hence its inclusion (along with Dialect.getResultSet(java.sql.CallableStatement)
) here.
registerResultSetOutParameter
in class Dialect
statement
- The callable statement.col
- The bind position at which to register the OUT param.
SQLException
- Indicates problems registering the OUT param.public ResultSet getResultSet(CallableStatement ps) throws SQLException
Dialect
Dialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
,
extract the ResultSet
from the OUT parameter.
getResultSet
in class Dialect
ps
- The callable statement.
SQLException
- Indicates problems extracting the result set.public boolean supportsCommentOn()
supportsCommentOn
in class Dialect
public boolean supportsTemporaryTables()
Dialect
supportsTemporaryTables
in class Dialect
public String getCreateTemporaryTableString()
Dialect
getCreateTemporaryTableString
in class Dialect
public String getCreateTemporaryTablePostfix()
Dialect
getCreateTemporaryTablePostfix
in class Dialect
public String generateTemporaryTableName(String baseTableName)
Dialect
generateTemporaryTableName
in class Dialect
baseTableName
- The table name from which to base the temp table name.
public boolean supportsCurrentTimestampSelection()
Dialect
supportsCurrentTimestampSelection
in class Dialect
public String getCurrentTimestampSelectString()
Dialect
getCurrentTimestampSelectString
in class Dialect
public boolean isCurrentTimestampSelectStringCallable()
Dialect
Dialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
sytnax is being used...
isCurrentTimestampSelectStringCallable
in class Dialect
Dialect.getCurrentTimestampSelectString()
return
is callable; false otherwise.public boolean supportsParametersInInsertSelect()
Dialect
supportsParametersInInsertSelect
in class Dialect
public String getCurrentTimestampSQLFunctionName()
Dialect
getCurrentTimestampSQLFunctionName
in class Dialect
public boolean supportsEmptyInList()
Dialect
supportsEmptyInList
in class Dialect
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |