站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

MySQLDialect (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.dialect
Class MySQLDialect

java.lang.Object
  extended bynet.sf.hibernate.dialect.Dialect
      extended bynet.sf.hibernate.dialect.MySQLDialect

public class MySQLDialect
extends Dialect

An SQL dialect for MySQL.

Author:
Gavin King

Field Summary
 
Fields inherited from class net.sf.hibernate.dialect.Dialect
CLOSED_QUOTE, QUOTE
 
Constructor Summary
MySQLDialect()
           
 
Method Summary
 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
 boolean dropConstraints()
          Do we need to drop constraints before dropping tables in this dialect?
 String getAddColumnString()
          The syntax used to add a column to a table (optional).
 String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey)
          The syntax used to add a foreign key constraint to a table.
 String getDropForeignKeyString()
           
 String getIdentityColumnString()
          The keyword used to specify an identity column, if identity column key generation is supported.
 String getIdentitySelectString()
          The syntax that returns the identity value of the last insert, if identity column key generation is supported.
 String getLimitString(String sql, boolean hasOffset)
          Add a LIMIT clause to the given SQL SELECT
 char getSchemaSeparator()
          The separator between the schema/tablespace name and the table name.
 char openQuote()
          The opening quote for a quoted identifier
 boolean qualifyIndexName()
          Do we need to qualify index names with the schema name?
 boolean supportsIdentityColumns()
          Does this dialect support identity column key generation?
 boolean supportsIfExistsBeforeTableName()
           
 boolean supportsLimit()
          Does this Dialect have some kind of LIMIT syntax?
 
Methods inherited from class net.sf.hibernate.dialect.Dialect
appendIdentitySelectToInsert, bindLimitParametersFirst, bindLimitParametersInReverseOrder, createCaseFragment, createOuterJoinFragment, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCreateSequenceString, getDefaultProperties, getDialect, getDialect, getDropSequenceString, getFunctions, getIdentityInsertString, getLimitString, getLowercaseFunction, getNoColumnsInsertString, getNullColumnString, getQuerySequencesString, getSequenceNextValString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, registerColumnType, registerColumnType, registerFunction, supportsCheck, supportsForUpdate, supportsForUpdateNowait, supportsForUpdateOf, supportsIfExistsAfterTableName, supportsLimitOffset, supportsSequences, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MySQLDialect

public MySQLDialect()
Method Detail

getAddColumnString

public String getAddColumnString()
Description copied from class: Dialect
The syntax used to add a column to a table (optional).

Overrides:
getAddColumnString in class Dialect

getDropForeignKeyString

public String getDropForeignKeyString()
Overrides:
getDropForeignKeyString in class Dialect

dropConstraints

public boolean dropConstraints()
Description copied from class: Dialect
Do we need to drop constraints before dropping tables in this dialect?

Overrides:
dropConstraints in class Dialect
Returns:
boolean

qualifyIndexName

public boolean qualifyIndexName()
Description copied from class: Dialect
Do we need to qualify index names with the schema name?

Overrides:
qualifyIndexName in class Dialect
Returns:
boolean

supportsIdentityColumns

public boolean supportsIdentityColumns()
Description copied from class: Dialect
Does this dialect support identity column key generation?

Overrides:
supportsIdentityColumns in class Dialect
Returns:
boolean

getIdentitySelectString

public String getIdentitySelectString()
Description copied from class: Dialect
The syntax that returns the identity value of the last insert, if identity column key generation is supported.

Overrides:
getIdentitySelectString in class Dialect

getIdentityColumnString

public String getIdentityColumnString()
Description copied from class: Dialect
The keyword used to specify an identity column, if identity column key generation is supported.

Overrides:
getIdentityColumnString in class Dialect

getAddForeignKeyConstraintString

public String getAddForeignKeyConstraintString(String constraintName,
                                               String[] foreignKey,
                                               String referencedTable,
                                               String[] primaryKey)
Description copied from class: Dialect
The syntax used to add a foreign key constraint to a table.

Overrides:
getAddForeignKeyConstraintString in class Dialect
Returns:
String

supportsLimit

public boolean supportsLimit()
Description copied from class: Dialect
Does this Dialect have some kind of LIMIT syntax?

Overrides:
supportsLimit in class Dialect

getLimitString

public String getLimitString(String sql,
                             boolean hasOffset)
Description copied from class: Dialect
Add a LIMIT clause to the given SQL SELECT

Overrides:
getLimitString in class Dialect
Returns:
the modified SQL

closeQuote

public char closeQuote()
Description copied from class: Dialect
The closing quote for a quoted identifier

Overrides:
closeQuote in class Dialect

openQuote

public char openQuote()
Description copied from class: Dialect
The opening quote for a quoted identifier

Overrides:
openQuote in class Dialect

supportsIfExistsBeforeTableName

public boolean supportsIfExistsBeforeTableName()
Overrides:
supportsIfExistsBeforeTableName in class Dialect

getSchemaSeparator

public char getSchemaSeparator()
Description copied from class: Dialect
The separator between the schema/tablespace name and the table name.

Overrides:
getSchemaSeparator in class Dialect

buildSQLExceptionConverter

public SQLExceptionConverter buildSQLExceptionConverter()
Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy. The default Dialect implementation simply returns a converter based on X/Open SQLState codes.

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 ErrorCode rather than the SQLState. Unfortunately, the ErrorCode is a vendor- specific approach.

Overrides:
buildSQLExceptionConverter in class Dialect
Returns:
The Dialect's preferred SQLExceptionConverter.