org.hibernate.dialect
Class MySQLDialect

java.lang.Object
  extended byorg.hibernate.dialect.Dialect
      extended byorg.hibernate.dialect.MySQLDialect
Direct Known Subclasses:
MySQL5Dialect, MySQLInnoDBDialect, MySQLMyISAMDialect

public class MySQLDialect
extends Dialect

An SQL dialect for MySQL (prior to 5.x).

Author:
Gavin King

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, QUOTE
 
Constructor Summary
MySQLDialect()
           
 
Method Summary
 char closeQuote()
          The closing quote for a quoted identifier
 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 getCastTypeName(int code)
           
 String getColumnComment(String comment)
           
 String getCreateTemporaryTableString()
           
 String getCurrentTimestampSelectString()
           
 String getDropForeignKeyString()
           
 String getIdentityColumnString()
           
 String getIdentitySelectString()
           
 String getLimitString(String sql, boolean hasOffset)
          Add a LIMIT clause to the given SQL SELECT
 ResultSet getResultSet(CallableStatement ps)
           
 String getSelectGUIDString()
           
 String getTableComment(String comment)
           
 boolean isCurrentTimestampSelectStringCallable()
           
 char openQuote()
          The opening quote for a quoted identifier
 boolean qualifyIndexName()
          Do we need to qualify index names with the schema name?
 int registerResultSetOutParameter(CallableStatement statement, int col)
           
protected  void registerVarcharTypes()
           
 boolean supportsCascadeDelete()
           
 boolean supportsCurrentTimestampSelection()
           
 boolean supportsIdentityColumns()
          Does this dialect support identity column key generation?
 boolean supportsIfExistsBeforeTableName()
           
 boolean supportsLimit()
          Does this Dialect have some kind of LIMIT syntax?
 boolean supportsTemporaryTables()
           
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, createCaseFragment, createOuterJoinFragment, dropConstraints, dropTemporaryTableAfterUse, forUpdateOfColumns, generateTemporaryTableName, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCreateSequenceString, getCreateSequenceStrings, getCreateTemporaryTablePostfix, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropSequenceString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getKeywords, getLimitString, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getQuerySequencesString, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceNextValString, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, performTemporaryTableDDLInIsolation, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, supportsColumnCheck, supportsCommentOn, supportsIfExistsAfterTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsSequences, supportsTableCheck, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob, 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

registerVarcharTypes

protected void registerVarcharTypes()

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

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()
Overrides:
getIdentitySelectString in class Dialect

getIdentityColumnString

public String getIdentityColumnString()
Overrides:
getIdentityColumnString in class Dialect

getAddForeignKeyConstraintString

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

Overrides:
getAddForeignKeyConstraintString in class Dialect
Parameters:
referencesPrimaryKey - if false, constraint should be explicit about which column names the constraint refers to
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

getDropForeignKeyString

public String getDropForeignKeyString()
Overrides:
getDropForeignKeyString 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

getSelectGUIDString

public String getSelectGUIDString()
Overrides:
getSelectGUIDString in class Dialect

supportsCascadeDelete

public boolean supportsCascadeDelete()
Overrides:
supportsCascadeDelete in class Dialect

getTableComment

public String getTableComment(String comment)
Overrides:
getTableComment in class Dialect

getColumnComment

public String getColumnComment(String comment)
Overrides:
getColumnComment in class Dialect

supportsTemporaryTables

public boolean supportsTemporaryTables()
Overrides:
supportsTemporaryTables in class Dialect

getCreateTemporaryTableString

public String getCreateTemporaryTableString()
Overrides:
getCreateTemporaryTableString in class Dialect

getCastTypeName

public String getCastTypeName(int code)
Overrides:
getCastTypeName in class Dialect

supportsCurrentTimestampSelection

public boolean supportsCurrentTimestampSelection()
Overrides:
supportsCurrentTimestampSelection in class Dialect

isCurrentTimestampSelectStringCallable

public boolean isCurrentTimestampSelectStringCallable()
Overrides:
isCurrentTimestampSelectStringCallable in class Dialect

getCurrentTimestampSelectString

public String getCurrentTimestampSelectString()
Overrides:
getCurrentTimestampSelectString in class Dialect

registerResultSetOutParameter

public int registerResultSetOutParameter(CallableStatement statement,
                                         int col)
                                  throws SQLException
Overrides:
registerResultSetOutParameter in class Dialect
Throws:
SQLException

getResultSet

public ResultSet getResultSet(CallableStatement ps)
                       throws SQLException
Overrides:
getResultSet in class Dialect
Throws:
SQLException