|
|||||||||||
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.MySQLDialect
An SQL dialect for MySQL (prior to 5.x).
Field Summary |
Fields inherited from class org.hibernate.dialect.Dialect |
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE |
Constructor Summary | |
MySQLDialect()
|
Method Summary | |
boolean |
areStringComparisonsCaseInsensitive()
Are string comparisons implicitly case insensitive. |
char |
closeQuote()
The character specific to this dialect used to close 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)
Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given Types typecode. |
String |
getColumnComment(String comment)
|
String |
getCreateTemporaryTableString()
Command used to create a temporary table. |
String |
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestammp from the database. |
String |
getDropForeignKeyString()
|
String |
getIdentityColumnString()
The syntax used during DDL to define a column as being an IDENTITY. |
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. |
ResultSet |
getResultSet(CallableStatement ps)
Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int) ,
extract the ResultSet from the OUT parameter. |
String |
getSelectGUIDString()
Get the command used to select a GUID from the underlying database. |
String |
getTableComment(String comment)
|
boolean |
isCurrentTimestampSelectStringCallable()
Should the value returned by getCurrentTimestampSelectString()
be treated as callable. |
char |
openQuote()
The character specific to this dialect used to begin a quoted identifier. |
Boolean |
performTemporaryTableDDLInIsolation()
Does the dialect require that temporary table DDL statements occur in isolation from other statements? This would be the case if the creation would cause any current transaction to get committed implicitly. |
boolean |
qualifyIndexName()
Do we need to qualify index names with the schema name? |
int |
registerResultSetOutParameter(CallableStatement statement,
int col)
Registers an OUT parameter which will be returing a ResultSet . |
protected void |
registerVarcharTypes()
|
boolean |
supportsCascadeDelete()
|
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 |
supportsIfExistsBeforeTableName()
|
boolean |
supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause? |
boolean |
supportsLobValueChangePropogation()
Does the dialect support propogating changes to LOB values back to the database? Talking about mutating the internal value of the locator as opposed to supplying a new locator instance... |
boolean |
supportsRowValueConstructorSyntax()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax. |
boolean |
supportsSubqueryOnMutatingTable()
Does this dialect support referencing the table being mutated in a subquery. |
boolean |
supportsTemporaryTables()
Does this dialect support temporary tables? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MySQLDialect()
Method Detail |
protected void registerVarcharTypes()
public String getAddColumnString()
Dialect
getAddColumnString
in class Dialect
public boolean qualifyIndexName()
Dialect
qualifyIndexName
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 getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
Dialect
getAddForeignKeyConstraintString
in class Dialect
constraintName
- The FK constraint name.foreignKey
- The names of the columns comprising the FKreferencedTable
- The table referenced by the FKprimaryKey
- The explicit columns in the referencedTable referenced
by this FK.referencesPrimaryKey
- if false, constraint should be
explicit about which column names the constraint refers to
public boolean supportsLimit()
Dialect
supportsLimit
in class Dialect
public String getDropForeignKeyString()
getDropForeignKeyString
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 char closeQuote()
Dialect
closeQuote
in class Dialect
public char openQuote()
Dialect
public boolean supportsIfExistsBeforeTableName()
supportsIfExistsBeforeTableName
in class Dialect
public String getSelectGUIDString()
Dialect
getSelectGUIDString
in class Dialect
public boolean supportsCascadeDelete()
supportsCascadeDelete
in class Dialect
public String getTableComment(String comment)
getTableComment
in class Dialect
public String getColumnComment(String comment)
getColumnComment
in class Dialect
public boolean supportsTemporaryTables()
Dialect
supportsTemporaryTables
in class Dialect
public String getCreateTemporaryTableString()
Dialect
getCreateTemporaryTableString
in class Dialect
public String getCastTypeName(int code)
Dialect
Types
typecode.
getCastTypeName
in class Dialect
code
- The Types
typecode
public boolean supportsCurrentTimestampSelection()
Dialect
supportsCurrentTimestampSelection
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 String getCurrentTimestampSelectString()
Dialect
getCurrentTimestampSelectString
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 supportsRowValueConstructorSyntax()
Dialect
supportsRowValueConstructorSyntax
in class Dialect
public Boolean performTemporaryTableDDLInIsolation()
Dialect
DatabaseMetaData.dataDefinitionCausesTransactionCommit()
method. However, that does not distinguish between temporary table
DDL and other forms of DDL; MySQL, for example, reports DDL causing a
transaction commit via its driver, even though that is not the case for
temporary table DDL.
Possible return values and their meanings:Boolean.TRUE
- Unequivocally, perform the temporary table DDL
in isolation.Boolean.FALSE
- Unequivocally, do not perform the
temporary table DDL in isolation.DatabaseMetaData.dataDefinitionCausesTransactionCommit()
performTemporaryTableDDLInIsolation
in class Dialect
public boolean supportsEmptyInList()
Dialect
supportsEmptyInList
in class Dialect
public boolean areStringComparisonsCaseInsensitive()
Dialect
areStringComparisonsCaseInsensitive
in class Dialect
public boolean supportsLobValueChangePropogation()
Dialect
Blob.setBinaryStream(long)
,
Blob.setBytes(long, byte[])
,
Blob.setBytes(long, byte[], int, int)
,
or Blob.truncate(long)
.
For CLOBs, the internal value might be changed by:
Clob.setAsciiStream(long)
,
Clob.setCharacterStream(long)
,
Clob.setString(long, String)
,
Clob.setString(long, String, int, int)
,
or Clob.truncate(long)
.
NOTE : I do not know the correct answer currently for
databases which (1) are not part of the cruise control process
or (2) do not Dialect.supportsExpectedLobUsagePattern()
.
supportsLobValueChangePropogation
in class Dialect
public boolean supportsSubqueryOnMutatingTable()
Dialect
supportsSubqueryOnMutatingTable
in class Dialect
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |