|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.model.GeneratedClass
ch.sahits.model.java.GeneratedJavaClass
ch.sahits.model.java.GeneratedJavaDBClass
ch.sahits.model.java.db.DataBaseTable
public class DataBaseTable
This bean represents the meta data of a table. Values like field, type, constrains and indexes are stored.
| Constructor Summary | |
|---|---|
DataBaseTable(java.lang.String product,
java.lang.String className)
Initialize the object with the database product |
|
DataBaseTable(java.lang.String product,
java.lang.String packageName,
java.lang.String className)
Initialize the object with the database product |
|
DataBaseTable(java.lang.String product,
java.lang.String _schema,
java.lang.String packageName,
java.lang.String className)
Initialize the object with the database product |
|
DataBaseTable(java.lang.String product,
java.lang.String _tableName,
java.lang.String _schema,
java.lang.String packageName,
java.lang.String className)
Initialize the object with the database product |
|
| Method Summary | |
|---|---|
void |
add(DataBaseTableField field)
Add a database field. |
void |
add(DataBaseTableIndex ind)
Add a database index. |
boolean |
equals(java.lang.Object obj)
Two database tables are the same if they have the same name, the same fields (irrelevant of their order) and the same indices (irrelevant of their order) |
DataBaseTableField |
findField(java.lang.String fieldName)
Find the field with the name fieldName |
DataBaseTableIndex |
findIndex(java.lang.String indexName)
Find the index with the name indexName |
DataBaseTableIndex |
findPrimaryIndex()
Find the index which's name start with PK_. |
java.util.List<DataBaseTableIndex> |
forginKeys()
Retrieve a list of all indexes that represent a forgin key |
java.lang.String |
getDbName()
|
java.util.List<DataBaseTableField> |
getFields()
Retrieve a list of the database fields. |
java.lang.String |
getHost()
|
java.util.List<DataBaseTableIndex> |
getIndexes()
Retrieve a list of all table indexes |
java.lang.String |
getPassword()
|
java.lang.String |
getPort()
|
java.lang.String |
getSchema()
Retrieve the schema. |
java.lang.String |
getTableName()
Retrieve the table name |
java.lang.String |
getUserName()
|
int |
hashCode()
|
boolean |
isPrimaryKey(DataBaseTableField field)
Check wether the field is part of the primary key |
java.util.List<DataBaseTableIndex> |
otherKeys()
Retrieve a list of all indexes that represent an index that is not a primary key nor a forgin key nor a unique index |
void |
setDbName(java.lang.String _dbName)
|
void |
setFieldAt(int index,
DataBaseTableField field)
Set a database field at position index |
void |
setFieldAt(int index,
DataBaseTableIndex ind)
Set a database index at position index |
void |
setFields(java.util.List<DataBaseTableField> _fields)
Set the DataBaseTableField s |
void |
setHost(java.lang.String _host)
|
void |
setIndexes(java.util.List<DataBaseTableIndex> _indexes)
Set the DataBaseTableIndex s |
void |
setPassword(java.lang.String _password)
|
void |
setPort(java.lang.String _port)
|
void |
setSchema(java.lang.String _schema)
Set the database schema. |
void |
setTableName(java.lang.String _tableName)
Set the table name. |
void |
setUserName(java.lang.String _userName)
|
java.lang.String |
toString()
Convert this into a string representation |
java.util.List<DataBaseTableIndex> |
uniqueKeys()
Retrieve a list of all indexes that represent a unique key |
java.util.List<java.lang.Class> |
usedClasses()
Return all classes that are used as database fields |
| Methods inherited from class ch.sahits.model.java.GeneratedJavaDBClass |
|---|
getDbProductName, setDbProductName |
| Methods inherited from class ch.sahits.model.GeneratedClass |
|---|
getClassName, hasSuperClass, setClassName, superclasses |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ch.sahits.model.db.IDBTable |
|---|
getDbProductName |
| Methods inherited from interface ch.sahits.model.db.IBasicDataBaseTable |
|---|
getDbProductName |
| Methods inherited from interface ch.sahits.model.java.IGeneratedJavaClass |
|---|
setAbstract, setAstTemplateUse, setClassName, setFinal, setGeneratorClassPath, setGeneratorClassPathInPlugin, setGeneratorUse, setInputFilePath, setJetFileUse, setJetTemplateInPlugin, setJetTemplatePath, setJetTemplateUse, setJProject, setPackageName, setReferenceImplementationPath, setSrcPath, setVisibility |
| Methods inherited from interface ch.sahits.model.java.IGeneratedJavaClass2 |
|---|
getClassName, getGeneratorClassPath, getInputFilePath, getInterfaces, getJetTemplatePath, getJProject, getPackageName, getReferenceImplementationPath, getSrcPath, getVisibility, interfaces, isAbstract, isAstTemplateUse, isFinal, isGeneratorClassPathInPlugin, isGeneratorUse, isJetFileUse, isJetTemplateInPlugin, isJetTemplateUse, isPackageDefault, isPrivate, isProtected, isPublic, isSympleType |
| Methods inherited from interface ch.sahits.model.IGeneratorClass |
|---|
addSuperClass |
| Methods inherited from interface ch.sahits.model.IGeneratorClass2 |
|---|
hasSuperClass, superclasses |
| Constructor Detail |
|---|
public DataBaseTable(java.lang.String product,
java.lang.String _tableName,
java.lang.String _schema,
java.lang.String packageName,
java.lang.String className)
product - Indicates which database product is used (Oracle, MySQL, ...)_tableName - Name of the table_schema - Schema of the table, may be nullpackageName - name of the package may be nullclassName - name of the class
public DataBaseTable(java.lang.String product,
java.lang.String _schema,
java.lang.String packageName,
java.lang.String className)
product - Indicates which database product is used (Oracle, MySQL, ...)_schema - Schema of the tablepackageName - name of the package may be nullclassName - name of the class
public DataBaseTable(java.lang.String product,
java.lang.String packageName,
java.lang.String className)
product - Indicates which database product is used (Oracle, MySQL, ...)packageName - name of the packageclassName - name of the class
public DataBaseTable(java.lang.String product,
java.lang.String className)
product - Indicates which database product is used (Oracle, MySQL, ...)className - name of the class| Method Detail |
|---|
public java.lang.String getSchema()
getSchema in interface IBasicDataBaseTablegetSchema in interface IDBTablepublic void setSchema(java.lang.String _schema)
setSchema in interface IDBTable_schema - public java.lang.String getTableName()
getTableName in interface IBasicDataBaseTablegetTableName in interface IDataBaseTablegetTableName in interface IDBTablepublic void setTableName(java.lang.String _tableName)
setTableName in interface IDataBaseTablesetTableName in interface IDBTable_tableName - public java.util.List<DataBaseTableField> getFields()
getFields in interface IBasicDataBaseTablegetFields in interface IDataBaseTableDataBaseTableField spublic void setFields(java.util.List<DataBaseTableField> _fields)
DataBaseTableField s
_fields -
public void setFieldAt(int index,
DataBaseTableField field)
index
index - positionfield - public void add(DataBaseTableField field)
add in interface IDataBaseTablefield - public java.util.List<DataBaseTableIndex> getIndexes()
getIndexes in interface IBasicDataBaseTablegetIndexes in interface IDataBaseTableDataBaseTableIndex spublic void setIndexes(java.util.List<DataBaseTableIndex> _indexes)
DataBaseTableIndex s
setIndexes in interface IDataBaseTable_indexes -
public void setFieldAt(int index,
DataBaseTableIndex ind)
index
index - positionind - public void add(DataBaseTableIndex ind)
add in interface IDataBaseTableind - public java.lang.String toString()
toString in class java.lang.Objectpublic DataBaseTableField findField(java.lang.String fieldName)
fieldName
findField in interface IBasicDataBaseTablefieldName - name of the field
DataBaseTableField or null if the field is not foundpublic java.util.List<java.lang.Class> usedClasses()
usedClasses in interface IDataBaseTablepublic DataBaseTableIndex findIndex(java.lang.String indexName)
indexName
findIndex in interface IBasicDataBaseTableindexName - name of the index
DataBaseTableIndex or null if the index is not foundpublic DataBaseTableIndex findPrimaryIndex()
findPrimaryIndex in interface IBasicDataBaseTablepublic java.lang.String getHost()
getHost in interface IBasicDataBaseTablegetHost in interface IDBTablepublic void setHost(java.lang.String _host)
setHost in interface IDBTable_host - the host to setpublic java.lang.String getPort()
getPort in interface IBasicDataBaseTablegetPort in interface IDBTablepublic void setPort(java.lang.String _port)
setPort in interface IDBTable_port - the port to setpublic java.lang.String getUserName()
getUserName in interface IBasicDataBaseTablegetUserName in interface IDBTablepublic void setUserName(java.lang.String _userName)
setUserName in interface IDBTable_userName - the userName to setpublic java.lang.String getPassword()
getPassword in interface IBasicDataBaseTablegetPassword in interface IDBTablepublic void setPassword(java.lang.String _password)
setPassword in interface IDBTable_password - the password to setpublic java.lang.String getDbName()
getDbName in interface IBasicDataBaseTablegetDbName in interface IDBTablepublic void setDbName(java.lang.String _dbName)
setDbName in interface IDBTable_dbName - the dbName to setpublic int hashCode()
hashCode in class GeneratedJavaClassObject.hashCode()public boolean equals(java.lang.Object obj)
equals in class GeneratedJavaClassObject.equals(java.lang.Object)public java.util.List<DataBaseTableIndex> uniqueKeys()
uniqueKeys in interface IBasicDataBaseTableuniqueKeys in interface IDataBaseTablepublic boolean isPrimaryKey(DataBaseTableField field)
field - to be checked
public java.util.List<DataBaseTableIndex> forginKeys()
IBasicDataBaseTable
forginKeys in interface IBasicDataBaseTablepublic java.util.List<DataBaseTableIndex> otherKeys()
IBasicDataBaseTable
otherKeys in interface IBasicDataBaseTable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||