|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biomage.tools.generate_er.CreateMageER
public class CreateMageER
Field Summary | |
---|---|
static java.lang.String |
ABSTRACT
the object (table) is abstract |
static java.lang.String |
aLine
a line for seperation |
static java.lang.String |
DATA
table type is data |
static java.lang.String |
FALSE
the foreign key does not cause a cascade action |
static java.lang.String |
FIRSTLINE
first line in the MAGE_ER.xml file |
static java.lang.String |
FOREIGNKEY
indicate the column is a one_to_one foreign key. |
static java.lang.String |
HALF_INDENT
one indent: a tab key |
static java.lang.String |
ID
name of the primary key for tables |
static java.lang.String |
INDENT
one indent: a tab key |
static java.lang.String |
INTEGER
association column type is int, and also columns in linking table |
static java.lang.String |
LINKING
table type is linking |
static java.lang.String |
LINKING_FKEY
foreign key type is many to many |
static java.lang.String |
LOOKUP_FKEY
foreign key type is for look up table |
static java.lang.String |
NEWLINE
a new line character |
static java.lang.String |
NO_BASE_CLASS
the object (table) does not have base class |
static java.lang.String |
NOT_ABSTRACT
the object (table) is not abstract |
static java.lang.String |
NOT_NULL
the column can not be null |
static java.lang.String |
NULL
the column can be null |
static java.lang.String |
ONE_TO_MANY
foreign key type is one to many |
static java.lang.String |
ONE_TO_ONE
foreign key type is one to one |
static java.lang.String |
oneIndent
one indent: a tab key |
static java.lang.String |
PRIMARY_KEY
full name of the primary key for tables |
static java.lang.String |
SECONDLINE
second line in the MAGE_ER.xml file |
static java.lang.String |
SERIAL
type of the primary key for tables |
static java.lang.String |
SUBSET
table type is subset |
static java.lang.String |
TRUE
the foreign key causes a cascade action |
static java.lang.String |
VALIDATION
table type is validation |
static java.lang.String |
VIEW
table type is view |
Constructor Summary | |
---|---|
CreateMageER()
Description: Constructor for the CreateMageER object. |
Method Summary | |
---|---|
protected java.lang.String |
alphabetLinkingTabelName(java.lang.String string1,
java.lang.String string2)
Description: compare two strings and link them alphabetically if string1 < string2: negative number |
void |
buildTables(java.lang.String outputDir,
java.util.Vector classes)
|
protected boolean |
CheckRelationship(java.util.Vector otmVector,
java.lang.String oriType,
boolean owner)
Description: check to see if there is the case that A has two one_to_many relationships with B and get the same name |
protected Index |
createIndex(AssociationColumn column,
java.lang.String tableName,
java.lang.String columnName)
Description: create a Index object for a foreign key fk_oto does not have index fk_mto has index fk_mtm has index |
protected AssociationColumn |
createLinkColumn(java.lang.String className)
Description: create a column for a linking table |
protected LinkingKey |
createLinkingKey(AssociationColumn link1,
AssociationColumn link2)
Description: create a linkingKey object and set into the table |
protected Table |
createLinkingTable(CreateFile createFile,
java.lang.String oriType)
Description: create a linking table |
protected Unique |
createUnique(java.util.Vector uniqueVector)
Description: create a Unique object which takes a vector of columns |
protected java.lang.String |
getDatatype(CreateFile.AttrInformation attr)
Description: Pass through get method for datatype. |
protected java.lang.String |
getFullName(java.lang.String name)
Description: change the first letter to be capitalized and insert a space between words dataType to Data Type |
protected java.lang.String |
lowerCaseFirstLetter(java.lang.String name)
Description: change the first letter of a string to be lower case |
protected void |
ManyToMany(CreateFile createFile,
java.lang.String oriType)
Description: create an association column for many to many relationship |
protected void |
ManyToOne(Table table,
AssociationColumn column,
CreateFile createFile,
CreateFile.AssociationAttrInformation attr,
java.io.FileWriter w)
Description: create an association column for one to one relationship |
protected void |
OneToMany(Table table,
AssociationColumn column,
CreateFile createFile,
CreateFile.AssociationAttrInformation attr)
Description: create an association column for one to one relationship |
protected void |
OneToOne(Table table,
AssociationColumn column,
CreateFile createFile,
CreateFile.AssociationAttrInformation attr)
Description: create an association column for one to one relationship |
void |
writeAbstractInfo(CreateFile createFile,
Table table)
Description: set the if the the class (table) is abstract |
void |
writeAssociationInfo(CreateFile createFile,
Table table,
java.io.FileWriter w)
Description: set an association's name, scope, and data type. |
void |
writeAttrInfo(CreateFile createFile,
Table table)
Description: set an attribute's name, scope, and data type. |
void |
writeBaseClassName(CreateFile createFile,
Table table)
Description: set the base class name for the class |
protected void |
WriteMAGEER(java.util.Map tableMap,
java.io.FileWriter f3,
java.io.FileWriter w)
Description: traverse the map and write out the MAGEER.xml |
protected void |
WriteOneTable(Table table,
java.io.FileWriter f3)
Description: write one table to the output file |
void |
writeTableName(CreateFile createFile,
Table table)
Description: set the table name and create primary key column and set the primary key into the table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NEWLINE
public static final java.lang.String oneIndent
public static final java.lang.String INDENT
public static final java.lang.String HALF_INDENT
public static final java.lang.String aLine
public static final java.lang.String FOREIGNKEY
public static final java.lang.String ID
public static final java.lang.String SERIAL
public static final java.lang.String PRIMARY_KEY
public static final java.lang.String NOT_NULL
public static final java.lang.String NULL
public static final java.lang.String ABSTRACT
public static final java.lang.String NOT_ABSTRACT
public static final java.lang.String NO_BASE_CLASS
public static final java.lang.String TRUE
public static final java.lang.String FALSE
public static final java.lang.String INTEGER
public static final java.lang.String DATA
public static final java.lang.String VALIDATION
public static final java.lang.String LINKING
public static final java.lang.String VIEW
public static final java.lang.String SUBSET
public static final java.lang.String ONE_TO_ONE
public static final java.lang.String ONE_TO_MANY
public static final java.lang.String LINKING_FKEY
public static final java.lang.String LOOKUP_FKEY
public static final java.lang.String FIRSTLINE
public static final java.lang.String SECONDLINE
Constructor Detail |
---|
public CreateMageER() throws java.lang.Exception
- Throws:
java.lang.Exception
-
Method Detail |
---|
public void buildTables(java.lang.String outputDir, java.util.Vector classes) throws java.lang.Exception
classes:
- vector of CreateClassFiles, one per
table (class).
java.lang.Exception
- for FileWriter
public void writeTableName(CreateFile createFile, Table table) throws java.lang.Exception
createFile:
- the object for the table we are creating
f1: file writer object
table: the table we are creating
java.lang.Exception
- for FileWriter
public void writeAttrInfo(CreateFile createFile, Table table) throws java.lang.Exception
createFile:
- the object for the table we are creating
f1: file writer object
table: the table we are creating
java.lang.Exception
- for FileWriter
protected java.lang.String getDatatype(CreateFile.AttrInformation attr) throws java.lang.Exception
attr:
- one simple data type attribute of the object
java.lang.Exception
- for FileWriter
protected java.lang.String getFullName(java.lang.String name) throws java.lang.Exception
name
- the string needs to be changed
f1: file writer object
java.lang.Exception
- for FileWriter
public void writeBaseClassName(CreateFile createFile, Table table) throws java.lang.Exception
createFile:
- the object for the table we are creating
f1: file writer object
table: the table we are creating
java.lang.Exception
- for FileWriter
public void writeAbstractInfo(CreateFile createFile, Table table) throws java.lang.Exception
createFile:
- the object for the table we are creating
f1: file writer object
table: the table we are creating
java.lang.Exception
- for FileWriter
public void writeAssociationInfo(CreateFile createFile, Table table, java.io.FileWriter w) throws java.lang.Exception
createFile:
- the object for the table we are creating
f1: file writer object
table: the table we are creating
java.lang.Exception
- for FileWriter
protected void OneToOne(Table table, AssociationColumn column, CreateFile createFile, CreateFile.AssociationAttrInformation attr) throws java.lang.Exception
name
- column name
oriType class name of the assocaition
owner if the association attribute owns this table
table: the table we are creating
column the column for the association
createFile: the object for the table we are creating
f1: file writer object
java.lang.Exception
- for FileWriter
protected void ManyToMany(CreateFile createFile, java.lang.String oriType) throws java.lang.Exception
createFile:
- the object for the table we are creating
oriType class name of the assocaition
f1: file writer object
java.lang.Exception
- for FileWriter
protected boolean CheckRelationship(java.util.Vector otmVector, java.lang.String oriType, boolean owner)
otmVector
- a vector to hold names of all associations
in the model
oriType class name of the assocaition
owner if the association attribute owns this table
java.lang.Exception
- for FileWriter
protected void OneToMany(Table table, AssociationColumn column, CreateFile createFile, CreateFile.AssociationAttrInformation attr) throws java.lang.Exception
name
- column name
oriType class name of the assocaition
owner if the association attribute owns this table
table the table we are creating
column the column for the association
createFile the object for the table we are creating
java.lang.Exception
- for FileWriter
protected void ManyToOne(Table table, AssociationColumn column, CreateFile createFile, CreateFile.AssociationAttrInformation attr, java.io.FileWriter w) throws java.lang.Exception
name
- column name
oriType class name of the assocaition
owner if the association attribute owns this table
table the table we are creating
column the column for the association
createFile the object for the table we are creating
java.lang.Exception
- for FileWriter
protected java.lang.String alphabetLinkingTabelName(java.lang.String string1, java.lang.String string2)
string1
- one string
string2 another string
none
- protected Table createLinkingTable(CreateFile createFile, java.lang.String oriType)
createFile
- the object for the table we are creating
oriType class name of the assocaition
none
- protected java.lang.String lowerCaseFirstLetter(java.lang.String name)
name
- of the string sent in to be changed
none
- protected AssociationColumn createLinkColumn(java.lang.String className)
name
- of the class for a column
none
- protected LinkingKey createLinkingKey(AssociationColumn link1, AssociationColumn link2)
link1
- one linking column
link2 another linking column
none
- protected Unique createUnique(java.util.Vector uniqueVector)
uniqueVector
- a vector has several columns
these columns combined together uniquely
identify a row
none
- protected Index createIndex(AssociationColumn column, java.lang.String tableName, java.lang.String columnName)
column
- the foreign key column
none
- protected void WriteMAGEER(java.util.Map tableMap, java.io.FileWriter f3, java.io.FileWriter w) throws java.lang.Exception
Map
- the map with all tables
f2 file writer for just a list of table names
f3 file for MAGEER.xml
none
-
java.lang.Exception
protected void WriteOneTable(Table table, java.io.FileWriter f3) throws java.lang.Exception
f3
- file for MAGEER.xml
table one table in the Map
fileWriter
- exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |