jimm.datavision.testdata.mysql
Class MySQLSchemaGen
java.lang.Object
org.xml.sax.helpers.DefaultHandler
jimm.datavision.testdata.SchemaGen
jimm.datavision.testdata.mysql.MySQLSchemaGen
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class MySQLSchemaGen
- extends SchemaGen
Field Summary |
protected static int |
MAX_VARCHAR_LEN
Max MySQL varchar length. |
Method Summary |
protected void |
endTable()
Outputs the SQL needed to close a create table statement. |
static void |
main(java.lang.String[] args)
|
protected void |
makeTable(java.lang.String tableName)
Outputs the SQL needed to create a database table. |
protected java.lang.String |
printableName(java.lang.String name)
|
protected void |
printNotNull()
Prints the SQL that defines a column as NOT NULL. |
protected void |
printPrimaryKey()
Prints the SQL that defines a column as a primary key. |
protected void |
printType(java.lang.String type,
int size)
Prints the SQL that defines a column's type. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_VARCHAR_LEN
protected static final int MAX_VARCHAR_LEN
- Max MySQL varchar length.
- See Also:
- Constant Field Values
MySQLSchemaGen
public MySQLSchemaGen()
printableName
protected java.lang.String printableName(java.lang.String name)
- Overrides:
printableName
in class SchemaGen
makeTable
protected void makeTable(java.lang.String tableName)
- Description copied from class:
SchemaGen
- Outputs the SQL needed to create a database table. Optionally prints
the SQL needed to destroy the table first.
- Specified by:
makeTable
in class SchemaGen
endTable
protected void endTable()
- Description copied from class:
SchemaGen
- Outputs the SQL needed to close a create table statement.
- Specified by:
endTable
in class SchemaGen
printType
protected void printType(java.lang.String type,
int size)
- Description copied from class:
SchemaGen
- Prints the SQL that defines a column's type.
- Specified by:
printType
in class SchemaGen
printNotNull
protected void printNotNull()
- Description copied from class:
SchemaGen
- Prints the SQL that defines a column as NOT NULL.
- Specified by:
printNotNull
in class SchemaGen
printPrimaryKey
protected void printPrimaryKey()
- Description copied from class:
SchemaGen
- Prints the SQL that defines a column as a primary key.
- Specified by:
printPrimaryKey
in class SchemaGen
main
public static void main(java.lang.String[] args)