org.codehaus.modello.generator.database.sql

Class MySqlBuilder


public class MySqlBuilder
extends SqlBuilder

An SQL Builder for MySQL
Version:
$Revision: 149 $
Authors:
James Strachan
John Marshall/Connectria

Constructor Summary

MySqlBuilder()

Method Summary

void
dropTable(Table table)
Outputs the DDL to drop the table
protected 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(List primaryKeyColumns)

Methods inherited from class org.codehaus.modello.generator.database.sql.SqlBuilder

alterColumn, columnsDiffer, createColumn, createDatabase, createDatabase, createTable, dropColumn, dropDatabase, dropIndex, dropTable, getIndent, getNativeType, getSqlType, getWriter, isForeignKeyConstraintsNamed, isForeignKeysEmbedded, isIndexesEmbedded, isPrimaryKeyEmbedded, print, printAutoIncrementColumn, printComment, printEndOfStatement, printIndent, printNotNullable, printNullable, println, println, setAlterTableForDrop, setForeignKeyConstraintsNamed, setForeignKeysEmbedded, setIndent, setIndexesEmbedded, setPrimaryKeyEmbedded, setWriter, shouldGeneratePrimaryKeys, tableComment, useAlterTableForDrop, writeAlterHeader, writeColumnTypes, writeEmbeddedIndexes, writeForeignKeyAlterTable, writeForeignKeys, writeForeignKeysAlterTable, writeForeignReferences, writeIndex, writeIndexes, writeLocalReferences, writePrimaryKeyStatement, writePrimaryKeys, writePrimaryKeysAlterTable

Constructor Details

MySqlBuilder

public MySqlBuilder()

Method Details

dropTable

public void dropTable(Table table)
            throws IOException
Outputs the DDL to drop the table
Overrides:
dropTable in interface SqlBuilder

getNativeType

protected String getNativeType(Column column)
Overrides:
getNativeType in interface SqlBuilder

printAutoIncrementColumn

protected void printAutoIncrementColumn(Table table,
                                        Column column)
            throws IOException
Outputs the fact that this column is an auto increment column.
Overrides:
printAutoIncrementColumn in interface SqlBuilder

shouldGeneratePrimaryKeys

protected boolean shouldGeneratePrimaryKeys(List primaryKeyColumns)
Overrides:
shouldGeneratePrimaryKeys in interface 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.