|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.orm.SqlDialect
org.ujorm.orm.dialect.MySqlDialect
public class MySqlDialect
Dialect for the MySQL since release 5.0 for the InnoDB engine.
http://dev.mysql.com/
| Field Summary | |
|---|---|
static int |
VARCHAR_MAX_LENGTH
The Max length of VARCHAR database type |
| Fields inherited from class org.ujorm.orm.SqlDialect |
|---|
COMMON_SEQ_TABLE_KEY, DEFAULT_SCHEMA_SYMBOL, ormHandler |
| Constructor Summary | |
|---|---|
MySqlDialect()
|
|
| Method Summary | |
|---|---|
protected String |
getColumnType(MetaColumn column)
MySQL dialect uses a database type DATETIME (instead of the TIMESTAMP) for the java.util.Date. |
protected String |
getEngine(MetaTable table)
Returns a MySQL enginge. |
String |
getJdbcDriver()
Returns a JDBC driver class name. |
String |
getJdbcUrl()
Returns a default JDBC URL |
boolean |
isCatalog()
Does the database support a catalog? The feature supports: MySqlDialect and MSSqlDialect. |
Appendable |
printComment(MetaColumn column,
Appendable out)
Important note for MySQL: the change of column modifies all another column attributes so the comment update can revert some hand-made changes different from meta-model. See the official MySQL documentation for more information. |
Appendable |
printComment(MetaTable table,
Appendable out)
Print a Comment on the table |
Appendable |
printDelete(CriterionDecoder decoder,
Appendable out)
Print an SQL DELETE statement. |
Appendable |
printNextSequence(String sequenceName,
MetaTable table,
Appendable out)
Create a SQL script for the NEXT SEQUENCE from a native database sequencer TIP: SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = $dbName AND TABLE_NAME = $tblName. |
Appendable |
printQuotedNameAlways(CharSequence name,
Appendable sql)
Prints quoted name (identifier) to SQL always. |
Appendable |
printSequenceTable(MetaDatabase db,
Appendable out)
Print SQL CREATE SEQUENCE. |
Appendable |
printTable(MetaTable table,
Appendable out)
Print a SQL script to create table |
Appendable |
printUpdate(List<MetaColumn> changedColumns,
CriterionDecoder decoder,
Appendable out)
Print an SQL UPDATE statement. |
protected Appendable |
printWhere(CriterionDecoder decoder,
TableWrapper[] tables,
Appendable out)
Print where condition for DELETE / UPDATE TODO: FIX THE IMPLEMENTATION - probably in the CriterionDecoder class |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int VARCHAR_MAX_LENGTH
| Constructor Detail |
|---|
public MySqlDialect()
| Method Detail |
|---|
public String getJdbcUrl()
SqlDialect
getJdbcUrl in class SqlDialectpublic String getJdbcDriver()
SqlDialect
getJdbcDriver in class SqlDialectpublic boolean isCatalog()
isCatalog in class SqlDialecttrue.
public Appendable printDelete(CriterionDecoder decoder,
Appendable out)
throws IOException
printDelete in class SqlDialectIOException
public Appendable printUpdate(List<MetaColumn> changedColumns,
CriterionDecoder decoder,
Appendable out)
throws IOException
SqlDialect
printUpdate in class SqlDialectIOException
protected Appendable printWhere(CriterionDecoder decoder,
TableWrapper[] tables,
Appendable out)
throws IOException
IOException
public Appendable printSequenceTable(MetaDatabase db,
Appendable out)
throws IOException
SqlDialect
printSequenceTable in class SqlDialectIOException
public Appendable printTable(MetaTable table,
Appendable out)
throws IOException
SqlDialect
printTable in class SqlDialectIOExceptionprotected String getEngine(MetaTable table)
protected String getColumnType(MetaColumn column)
getColumnType in class SqlDialect
public Appendable printComment(MetaTable table,
Appendable out)
throws IOException
printComment in class SqlDialectIOException
public Appendable printComment(MetaColumn column,
Appendable out)
throws IOException
printComment in class SqlDialectIOException
public Appendable printQuotedNameAlways(CharSequence name,
Appendable sql)
throws IOException
printQuotedNameAlways in class SqlDialectname - Name (identifier) for quotingsql - Target SQL for printing new quoted name
IOException
public Appendable printNextSequence(String sequenceName,
MetaTable table,
Appendable out)
throws IOException
printNextSequence in class SqlDialectIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||