org.codehaus.modello.generator.database.sql
Class MySqlBuilder

java.lang.Object
  extended by org.codehaus.modello.generator.database.sql.SqlBuilder
      extended by org.codehaus.modello.generator.database.sql.MySqlBuilder

public class MySqlBuilder
extends SqlBuilder

An SQL Builder for MySQL

Version:
$Revision: 149 $
Author:
James Strachan, John Marshall/Connectria

Constructor Summary
MySqlBuilder()
           
 
Method Summary
 void dropTable(Table table)
          Outputs the DDL to drop the table
protected  java.lang.String getNativeType(Column column)
           
protected  void printAutoIncrementColumn(Table table, Column column)
          Outputs the fact that this column is an auto increment column.
protected  boolean shouldGeneratePrimaryKeys(java.util.List primaryKeyColumns)
           
 
Methods inherited from class org.codehaus.modello.generator.database.sql.SqlBuilder
alterColumn, columnsDiffer, createColumn, createDatabase, createDatabase, createTable, dropColumn, dropDatabase, dropIndex, getIndent, getSqlType, getWriter, isForeignKeyConstraintsNamed, isForeignKeysEmbedded, isIndexesEmbedded, isPrimaryKeyEmbedded, print, printComment, printEndOfStatement, printIndent, println, println, printNotNullable, printNullable, setAlterTableForDrop, setForeignKeyConstraintsNamed, setForeignKeysEmbedded, setIndent, setIndexesEmbedded, setPrimaryKeyEmbedded, setWriter, tableComment, useAlterTableForDrop, writeAlterHeader, writeColumnTypes, writeEmbeddedIndexes, writeForeignKeyAlterTable, writeForeignKeys, writeForeignKeysAlterTable, writeForeignReferences, writeIndex, writeIndexes, writeLocalReferences, writePrimaryKeys, writePrimaryKeysAlterTable, writePrimaryKeyStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySqlBuilder

public MySqlBuilder()
Method Detail

dropTable

public void dropTable(Table table)
               throws java.io.IOException
Description copied from class: SqlBuilder
Outputs the DDL to drop the table

Overrides:
dropTable in class SqlBuilder
Throws:
java.io.IOException

printAutoIncrementColumn

protected void printAutoIncrementColumn(Table table,
                                        Column column)
                                 throws java.io.IOException
Description copied from class: SqlBuilder
Outputs the fact that this column is an auto increment column.

Overrides:
printAutoIncrementColumn in class SqlBuilder
Throws:
java.io.IOException

shouldGeneratePrimaryKeys

protected boolean shouldGeneratePrimaryKeys(java.util.List primaryKeyColumns)
Overrides:
shouldGeneratePrimaryKeys in class SqlBuilder
Returns:
true if we should generate a primary key constraint for the given primary key columns. By default if there are no primary keys or the column(s) are all auto increment (identity) columns then there is no need to generate a primary key constraint.

getNativeType

protected java.lang.String getNativeType(Column column)
Overrides:
getNativeType in class SqlBuilder


Copyright © 2001-2007 Codehaus. All Rights Reserved.