org.ephman.abra.tools
Class SchemaGenerator

java.lang.Object
  extended byorg.ephman.abra.tools.GenericSchemaGenerator
      extended byorg.ephman.abra.tools.SchemaGenerator

public class SchemaGenerator
extends GenericSchemaGenerator

given a base output directory generate a schema file Sybase specific one !!

Version:
0.0.2
Author:
Paul M. Bethe

Field Summary
static java.lang.String dbPackageName
           
 
Fields inherited from class org.ephman.abra.tools.GenericSchemaGenerator
cleanup, cleanupConstraints, cleanupFile, constraintList, constraints, END_DATE, END_DATE_TYPE, fileSeperator, outdir, schemaFile, VERSION_NUMBER
 
Constructor Summary
SchemaGenerator(java.lang.String outFileName)
           
 
Method Summary
 void close()
          generic close if you want to write constraints -- override (see Oracle version)
 void generate(JClass currentClass)
           
protected  java.lang.String getDbSpecificOptions(JClass currentClass, JField jf, java.lang.String primaryKey)
          Return any required DB specific field options.
protected  java.lang.String getSqlOutType(JClass currentClass, JField jf)
           
(package private)  boolean needsSequence()
           
protected  void writeCheckConstraint(JClass currentClass, java.lang.String cons_name, JField jf)
           
protected  void writeForeignKey(JClass currentClass, java.lang.String cons_name, JField jf, JClass foreignClass)
           
protected  void writePrimaryKey(JClass currentClass, java.lang.String sqlName)
          generic primary in table creation..
 
Methods inherited from class org.ephman.abra.tools.GenericSchemaGenerator
addConstraint, addIndex, cleanUpConstraint, cleanUpIndex, convertFields, getDropSeqStmt, inlineField, jToSql, makeConstraintName, writeFieldSchema, writeUniqueConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbPackageName

public static java.lang.String dbPackageName
Constructor Detail

SchemaGenerator

public SchemaGenerator(java.lang.String outFileName)
                throws java.io.IOException,
                       SchemaException
Method Detail

close

public void close()
           throws java.io.IOException,
                  SchemaException
Description copied from class: GenericSchemaGenerator
generic close if you want to write constraints -- override (see Oracle version)

Overrides:
close in class GenericSchemaGenerator
Throws:
java.io.IOException
SchemaException

generate

public void generate(JClass currentClass)
              throws java.io.IOException,
                     SchemaException
Overrides:
generate in class GenericSchemaGenerator
Throws:
java.io.IOException
SchemaException

writeCheckConstraint

protected void writeCheckConstraint(JClass currentClass,
                                    java.lang.String cons_name,
                                    JField jf)
                             throws java.io.IOException
Overrides:
writeCheckConstraint in class GenericSchemaGenerator
Throws:
java.io.IOException

writePrimaryKey

protected void writePrimaryKey(JClass currentClass,
                               java.lang.String sqlName)
                        throws java.io.IOException
generic primary in table creation..

Overrides:
writePrimaryKey in class GenericSchemaGenerator
Throws:
java.io.IOException

writeForeignKey

protected void writeForeignKey(JClass currentClass,
                               java.lang.String cons_name,
                               JField jf,
                               JClass foreignClass)
                        throws java.io.IOException
Overrides:
writeForeignKey in class GenericSchemaGenerator
Throws:
java.io.IOException

getSqlOutType

protected java.lang.String getSqlOutType(JClass currentClass,
                                         JField jf)
                                  throws SchemaException
Overrides:
getSqlOutType in class GenericSchemaGenerator
Throws:
SchemaException

getDbSpecificOptions

protected java.lang.String getDbSpecificOptions(JClass currentClass,
                                                JField jf,
                                                java.lang.String primaryKey)
                                         throws SchemaException
Description copied from class: GenericSchemaGenerator
Return any required DB specific field options. Override as needed.

Overrides:
getDbSpecificOptions in class GenericSchemaGenerator
Throws:
SchemaException

needsSequence

boolean needsSequence()
Overrides:
needsSequence in class GenericSchemaGenerator