Model Class

Used to parse a model and generate code (e.g. Java and DDL).

Constructors

There are no public constructors.

Public Methods

getName( ) returns String
Returns the name of this model.
getPackageName( ) returns String
getFields( ) returns Field[]
Returns an array of all the fields found in this model.
getTableName( ) returns String
Returns the name of the table associated with this model.
getSchemaName( ) returns String
getJavaCode( ) returns String
Used to generate Java code for the model.
getTableSQL( ) returns String
Returns an SQL script used to create a table for the model. The schema is targeted for a PostgreSQL database.
getDiamondTableSQL( ) returns String
Returns an SQL script used to generate diamond tables and indexes
getForeignKeySQL( ) returns String
Returns an SQL script used to add foreign keys to a table associated with the model. Ordinarily, the foreign keys are defined inline with the create table script. However, that would require creating tables in a proper sequence which is difficult to do. Instead, it is easier to create all the tables first, then update the tables by adding a foreign key constraint.
getIndexSQL( ) returns String
Returns an SQL script used to add indexes to the table associated with the model.
getTriggerSQL( ) returns String
Returns an SQL script used to generate triggers
toString( ) returns String
Returns the name of this model.