|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.dialect.Dialect
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.
Field Summary | |
static String |
CLOSED_QUOTE
|
static String |
QUOTE
Characters used for quoting SQL identifiers |
Constructor Summary | |
protected |
Dialect()
|
Method Summary | |
String |
appendIdentitySelectToInsert(String insertString)
Append a clause to retrieve the generated identity value for the given INSERT statement. |
String |
appendLockHint(LockMode mode,
String tableName)
Method appendLockHint appends according to the given
lock mode a lock hint behind the given table name, if this dialect
needs this. |
boolean |
bindLimitParametersFirst()
Does the LIMIT clause come at the start of the SELECT statement, rather than at the end? |
boolean |
bindLimitParametersInReverseOrder()
Does the LIMIT clause specify arguments in the "reverse" order limit, offset instead of offset, limit? |
SQLExceptionConverter |
buildSQLExceptionConverter()
Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy. |
char |
closeQuote()
The closing quote for a quoted identifier |
CaseFragment |
createCaseFragment()
Create a CaseFragment for this dialect. |
JoinFragment |
createOuterJoinFragment()
Create an OuterJoinGenerator for this dialect. |
boolean |
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect? |
boolean |
dropTemporaryTableAfterUse()
|
boolean |
forUpdateOfColumns()
Does the FOR UPDATE OF syntax specify particular columns? |
String |
generateTemporaryTableName(String baseTableName)
|
String |
getAddColumnString()
The syntax used to add a column to a table (optional). |
String |
getAddForeignKeyConstraintString(String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey,
boolean referencesPrimaryKey)
The syntax used to add a foreign key constraint to a table. |
String |
getAddPrimaryKeyConstraintString(String constraintName)
The syntax used to add a primary key constraint to a table. |
String |
getCascadeConstraintsString()
Completely optional cascading drop clause |
String |
getCastTypeName(int code)
|
String |
getColumnComment(String comment)
|
protected String |
getCreateSequenceString(String sequenceName)
The syntax used to create a sequence, if sequences are supported. |
String[] |
getCreateSequenceStrings(String sequenceName)
The multiline script used to create a sequence, if sequences are supported. |
String |
getCreateTemporaryTablePostfix()
|
String |
getCreateTemporaryTableString()
|
String |
getCurrentTimestampSelectString()
|
String |
getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the current timestamp. |
Properties |
getDefaultProperties()
Retrieve a set of default Hibernate properties for this database. |
static Dialect |
getDialect()
Get the Dialect specified by the current System properties. |
static Dialect |
getDialect(Properties props)
Get the Dialect specified by the given properties or system properties. |
String |
getDropForeignKeyString()
|
protected String |
getDropSequenceString(String sequenceName)
The syntax used to drop a sequence, if sequences are supported. |
String[] |
getDropSequenceStrings(String sequenceName)
The multiline script used to drop a sequence, if sequences are supported. |
String |
getForUpdateNowaitString()
Does this dialect support the Oracle-style FOR UPDATE NOWAIT syntax? |
String |
getForUpdateNowaitString(String aliases)
Does this dialect support the Oracle-style FOR UPDATE OF ... |
String |
getForUpdateString()
Does this dialect support the FOR UPDATE syntax? |
String |
getForUpdateString(LockMode lockMode)
|
String |
getForUpdateString(String aliases)
Does this dialect support the FOR UPDATE OF syntax? |
Map |
getFunctions()
SQL functions as defined in general. |
String |
getHibernateTypeName(int code)
|
String |
getHibernateTypeName(int code,
int length,
int precision,
int scale)
|
protected String |
getIdentityColumnString()
|
String |
getIdentityColumnString(int type)
The keyword used to specify an identity column, if identity column key generation is supported. |
String |
getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null). |
protected String |
getIdentitySelectString()
|
String |
getIdentitySelectString(String table,
String column,
int type)
The syntax that returns the identity value of the last insert, if identity column key generation is supported. |
Set |
getKeywords()
|
String |
getLimitString(String querySelect,
boolean hasOffset)
Add a LIMIT clause to the given SQL SELECT |
String |
getLimitString(String querySelect,
int offset,
int limit)
|
String |
getLowercaseFunction()
The name of the SQL function that transforms a string to lowercase |
int |
getMaxAliasLength()
|
Class |
getNativeIdentifierGeneratorClass()
|
String |
getNoColumnsInsertString()
The keyword used to insert a row without specifying any column values. |
String |
getNullColumnString()
The keyword used to specify a nullable column. |
String |
getQuerySequencesString()
A query used to find all sequences |
ResultSet |
getResultSet(CallableStatement ps)
|
String |
getSelectClauseNullString(int sqlType)
|
String |
getSelectGUIDString()
|
String |
getSelectSequenceNextValString(String sequenceName)
Generate the select expression fragment that will retreive the next value of a sequence, if sequences are supported. |
String |
getSequenceNextValString(String sequenceName)
Generate the appropriate select statement to to retreive the next value of a sequence, if sequences are supported. |
String |
getTableComment(String comment)
|
String |
getTableTypeString()
|
String |
getTypeName(int code)
Get the name of the database type associated with the given java.sql.Types typecode. |
String |
getTypeName(int code,
int length,
int precision,
int scale)
Get the name of the database type associated with the given java.sql.Types typecode. |
ViolatedConstraintNameExtracter |
getViolatedConstraintNameExtracter()
|
boolean |
hasAlterTable()
Does this dialect support the ALTER TABLE syntax? |
boolean |
hasDataTypeInIdentityColumn()
Whether this dialect have an Identity clause added to the data type or a completely seperate identity data type |
boolean |
hasSelfReferentialForeignKeyBug()
|
boolean |
isCurrentTimestampSelectStringCallable()
|
char |
openQuote()
The opening quote for a quoted identifier |
boolean |
performTemporaryTableDDLInIsolation()
|
boolean |
qualifyIndexName()
Do we need to qualify index names with the schema name? |
String |
quote(String column)
|
protected void |
registerColumnType(int code,
int capacity,
String name)
Subclasses register a typename for the given type code and maximum column length. |
protected void |
registerColumnType(int code,
String name)
Subclasses register a typename for the given type code. |
protected void |
registerFunction(String name,
SQLFunction function)
|
protected void |
registerHibernateType(int sqlcode,
int capacity,
String name)
|
protected void |
registerHibernateType(int sqlcode,
String name)
|
protected void |
registerKeyword(String word)
|
int |
registerResultSetOutParameter(CallableStatement statement,
int col)
|
boolean |
supportsCascadeDelete()
|
boolean |
supportsColumnCheck()
Does this dialect support column-level check constraints? |
boolean |
supportsCommentOn()
|
boolean |
supportsCurrentTimestampSelection()
|
boolean |
supportsIdentityColumns()
Does this dialect support identity column key generation? |
boolean |
supportsIfExistsAfterTableName()
|
boolean |
supportsIfExistsBeforeTableName()
|
boolean |
supportsInsertSelectIdentity()
|
boolean |
supportsLimit()
Does this Dialect have some kind of LIMIT syntax? |
boolean |
supportsLimitOffset()
Does this dialect support an offset? |
boolean |
supportsNotNullUnique()
|
boolean |
supportsOuterJoinForUpdate()
|
boolean |
supportsParametersInInsertSelect()
Does this dialect support parameters within the select clause of INSERT ... |
boolean |
supportsSequences()
Does this dialect support sequences? |
boolean |
supportsTableCheck()
Does this dialect support table-level check constraints? |
boolean |
supportsTemporaryTables()
|
boolean |
supportsUnionAll()
|
boolean |
supportsUnique()
Does this dialect support the UNIQUE column syntax? |
boolean |
supportsUniqueConstraintInCreateAlterTable()
Does this dialect support adding Unique constraints via create and alter table ? |
boolean |
supportsVariableLimit()
|
String |
toBooleanValueString(boolean bool)
The SQL value that the JDBC driver maps boolean values to |
String |
toString()
|
String |
transformSelectString(String select)
|
boolean |
useInputStreamToInsertBlob()
|
boolean |
useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String QUOTE
public static final String CLOSED_QUOTE
Constructor Detail |
protected Dialect()
Method Detail |
public String toString()
public String getTypeName(int code) throws HibernateException
code
- java.sql.Types typecode
HibernateException
public String getHibernateTypeName(int code) throws HibernateException
HibernateException
public String getHibernateTypeName(int code, int length, int precision, int scale) throws HibernateException
HibernateException
public String getTypeName(int code, int length, int precision, int scale) throws HibernateException
code
- java.sql.Types typecodelength
- the length or precision of the columnprecision
- the precision of the columnscale
- the scale of the column
HibernateException
public String getCastTypeName(int code)
protected void registerFunction(String name, SQLFunction function)
protected void registerKeyword(String word)
public Set getKeywords()
protected void registerColumnType(int code, int capacity, String name)
code
- java.sql.Types typecodecapacity
- maximum length of database typename
- the database type nameprotected void registerColumnType(int code, String name)
code
- java.sql.Types typecodename
- the database type nameprotected void registerHibernateType(int sqlcode, String name)
protected void registerHibernateType(int sqlcode, int capacity, String name)
public boolean hasAlterTable()
public boolean dropConstraints()
public boolean qualifyIndexName()
public boolean forUpdateOfColumns()
public String getForUpdateString(String aliases)
public String getForUpdateNowaitString(String aliases)
public String getForUpdateString()
public String getForUpdateNowaitString()
public boolean supportsUnique()
public boolean supportsUniqueConstraintInCreateAlterTable()
public String getAddColumnString()
public String getDropForeignKeyString()
public String getTableTypeString()
public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
referencesPrimaryKey
- if false, constraint should be
explicit about which column names the constraint refers to
public String getAddPrimaryKeyConstraintString(String constraintName)
public String getNullColumnString()
public boolean supportsIdentityColumns()
public boolean supportsSequences()
public boolean supportsInsertSelectIdentity()
public String appendIdentitySelectToInsert(String insertString)
protected String getIdentitySelectString() throws MappingException
MappingException
public String getIdentitySelectString(String table, String column, int type) throws MappingException
type
- TODO
MappingException
- if no native key generationprotected String getIdentityColumnString() throws MappingException
MappingException
public String getIdentityColumnString(int type) throws MappingException
type
- the SQL column type, as defined by java.sql.Types
MappingException
- if no native key generationpublic String getIdentityInsertString()
public String getNoColumnsInsertString()
public String getSequenceNextValString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String getSelectSequenceNextValString(String sequenceName) throws MappingException
getSequenceNextValString(String)
in that this
should return an expression usable within another select statement.
sequenceName
- the name of the sequence
MappingException
- if no sequencesprotected String getCreateSequenceString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String[] getCreateSequenceStrings(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencesprotected String getDropSequenceString(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String[] getDropSequenceStrings(String sequenceName) throws MappingException
sequenceName
- the name of the sequence
MappingException
- if no sequencespublic String getQuerySequencesString()
SchemaUpdate
public static Dialect getDialect() throws HibernateException
HibernateException
public static Dialect getDialect(Properties props) throws HibernateException
props
-
HibernateException
public final Properties getDefaultProperties()
public String getCascadeConstraintsString()
public JoinFragment createOuterJoinFragment()
public CaseFragment createCaseFragment()
public String getLowercaseFunction()
public boolean supportsLimit()
public boolean supportsLimitOffset()
public String getLimitString(String querySelect, boolean hasOffset)
public String getLimitString(String querySelect, int offset, int limit)
public boolean supportsVariableLimit()
public boolean bindLimitParametersInReverseOrder()
public boolean bindLimitParametersFirst()
public boolean useMaxForLimit()
public char openQuote()
public char closeQuote()
public final Map getFunctions()
public boolean supportsIfExistsBeforeTableName()
public boolean supportsIfExistsAfterTableName()
public boolean supportsColumnCheck()
public boolean supportsTableCheck()
public boolean hasDataTypeInIdentityColumn()
public boolean supportsCascadeDelete()
public String appendLockHint(LockMode mode, String tableName)
appendLockHint
appends according to the given
lock mode a lock hint behind the given table name, if this dialect
needs this. MS SQL Server for example doesn't support the
standard "select ... for update
" syntax and use a
special "select ... from TABLE as ALIAS with (updlock, rowlock)
where ...
" syntax instead.
tableName
- name of table to append lock hint
public Class getNativeIdentifierGeneratorClass()
public String getSelectGUIDString()
public boolean supportsOuterJoinForUpdate()
public String getSelectClauseNullString(int sqlType)
public boolean supportsNotNullUnique()
public SQLExceptionConverter buildSQLExceptionConverter()
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
public final String quote(String column)
public boolean hasSelfReferentialForeignKeyBug()
public boolean useInputStreamToInsertBlob()
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
SQLException
public ResultSet getResultSet(CallableStatement ps) throws SQLException
SQLException
public boolean supportsUnionAll()
public boolean supportsCommentOn()
public String getTableComment(String comment)
public String getColumnComment(String comment)
public String transformSelectString(String select)
public boolean supportsTemporaryTables()
public String generateTemporaryTableName(String baseTableName)
public String getCreateTemporaryTableString()
public boolean performTemporaryTableDDLInIsolation()
public String getCreateTemporaryTablePostfix()
public boolean dropTemporaryTableAfterUse()
public String getForUpdateString(LockMode lockMode)
public int getMaxAliasLength()
public boolean supportsCurrentTimestampSelection()
public String getCurrentTimestampSelectString()
public boolean isCurrentTimestampSelectStringCallable()
public String toBooleanValueString(boolean bool)
public boolean supportsParametersInInsertSelect()
public String getCurrentTimestampSQLFunctionName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |