net.sf.hajdbc.dialect
Class MySQLDialect

java.lang.Object
  extended by net.sf.hajdbc.dialect.StandardDialect
      extended by net.sf.hajdbc.dialect.MySQLDialect
All Implemented Interfaces:
Dialect

public class MySQLDialect
extends StandardDialect

Dialect for MySQL

Author:
Paul Ferraro

Constructor Summary
MySQLDialect()
           
 
Method Summary
protected  String alterIdentityColumnFormat()
           
protected  String createForeignKeyConstraintFormat()
          Deferrability clause is not supported.
protected  String createUniqueConstraintFormat()
           
protected  String currentDatePattern()
           
protected  String currentTimePattern()
           
protected  String currentTimestampPattern()
           
protected  String dateLiteralFormat()
           
protected  String dropForeignKeyConstraintFormat()
           
protected  String dropUniqueConstraintFormat()
           
 List<String> getDefaultSchemas(DatabaseMetaData metaData)
          Returns a search path of schemas
 Collection<QualifiedName> getSequences(DatabaseMetaData metaData)
          Returns a collection of all sequences in this database.
 boolean isIdentity(ColumnProperties properties)
          Indicates whether or not the specified column is an identity column.
 String parseSequence(String sql)
          Parses a sequence name from the specified SQL statement.
protected  String timeLiteralFormat()
           
protected  String timestampLiteralFormat()
           
 
Methods inherited from class net.sf.hajdbc.dialect.StandardDialect
alterSequenceFormat, currentTimestampFunction, dropConstraintFormat, dummyTable, evaluateCurrentDate, evaluateCurrentTime, evaluateCurrentTimestamp, evaluateRand, executeFunction, executeFunctionFormat, executeFunctionSQL, executeQuery, getAlterIdentityColumnSQL, getAlterSequenceSQL, getColumnType, getCreateForeignKeyConstraintSQL, getCreateUniqueConstraintSQL, getDropForeignKeyConstraintSQL, getDropUniqueConstraintSQL, getIdentifierPattern, getNextSequenceValueSQL, getSimpleSQL, getTruncateTableSQL, insertIntoTablePattern, isSelectForUpdate, nextSequenceValueFormat, parse, parseInsertTable, randomPattern, selectForUpdatePattern, sequencePattern, sequenceTableType, truncateTableFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLDialect

public MySQLDialect()
Method Detail

getDefaultSchemas

public List<String> getDefaultSchemas(DatabaseMetaData metaData)
                               throws SQLException
Description copied from interface: Dialect
Returns a search path of schemas

Specified by:
getDefaultSchemas in interface Dialect
Overrides:
getDefaultSchemas in class StandardDialect
Returns:
a list of schema names
Throws:
SQLException
See Also:
StandardDialect.getDefaultSchemas(java.sql.DatabaseMetaData)

isIdentity

public boolean isIdentity(ColumnProperties properties)
Description copied from interface: Dialect
Indicates whether or not the specified column is an identity column.

Specified by:
isIdentity in interface Dialect
Overrides:
isIdentity in class StandardDialect
Parameters:
properties - a table column
Returns:
true, if this column is an identity column, false otherwise
See Also:
StandardDialect.isIdentity(net.sf.hajdbc.ColumnProperties)

parseSequence

public String parseSequence(String sql)
Description copied from interface: Dialect
Parses a sequence name from the specified SQL statement.

Specified by:
parseSequence in interface Dialect
Overrides:
parseSequence in class StandardDialect
Parameters:
sql - a SQL statement
Returns:
the name of a sequence, or null if this SQL statement does not reference a sequence or this dialect does not support sequences
See Also:
StandardDialect.parseSequence(java.lang.String)

getSequences

public Collection<QualifiedName> getSequences(DatabaseMetaData metaData)
                                       throws SQLException
Description copied from interface: Dialect
Returns a collection of all sequences in this database.

Specified by:
getSequences in interface Dialect
Overrides:
getSequences in class StandardDialect
Parameters:
metaData - database meta data
Returns:
a collection of sequence names
Throws:
SQLException
See Also:
StandardDialect.getSequences(java.sql.DatabaseMetaData)

createForeignKeyConstraintFormat

protected String createForeignKeyConstraintFormat()
Deferrability clause is not supported.

Overrides:
createForeignKeyConstraintFormat in class StandardDialect
See Also:
StandardDialect.createForeignKeyConstraintFormat()

createUniqueConstraintFormat

protected String createUniqueConstraintFormat()
Overrides:
createUniqueConstraintFormat in class StandardDialect
See Also:
StandardDialect.createUniqueConstraintFormat()

dropForeignKeyConstraintFormat

protected String dropForeignKeyConstraintFormat()
Overrides:
dropForeignKeyConstraintFormat in class StandardDialect
See Also:
StandardDialect.dropForeignKeyConstraintFormat()

dropUniqueConstraintFormat

protected String dropUniqueConstraintFormat()
Overrides:
dropUniqueConstraintFormat in class StandardDialect
See Also:
StandardDialect.dropUniqueConstraintFormat()

alterIdentityColumnFormat

protected String alterIdentityColumnFormat()
Overrides:
alterIdentityColumnFormat in class StandardDialect
See Also:
StandardDialect.alterIdentityColumnFormat()

currentDatePattern

protected String currentDatePattern()
Overrides:
currentDatePattern in class StandardDialect
See Also:
StandardDialect.currentDatePattern()

currentTimePattern

protected String currentTimePattern()
Overrides:
currentTimePattern in class StandardDialect
See Also:
StandardDialect.currentTimePattern()

currentTimestampPattern

protected String currentTimestampPattern()
Overrides:
currentTimestampPattern in class StandardDialect
See Also:
StandardDialect.currentTimestampPattern()

dateLiteralFormat

protected String dateLiteralFormat()
Overrides:
dateLiteralFormat in class StandardDialect
See Also:
StandardDialect.dateLiteralFormat()

timeLiteralFormat

protected String timeLiteralFormat()
Overrides:
timeLiteralFormat in class StandardDialect
See Also:
StandardDialect.timeLiteralFormat()

timestampLiteralFormat

protected String timestampLiteralFormat()
Overrides:
timestampLiteralFormat in class StandardDialect
See Also:
StandardDialect.timestampLiteralFormat()