|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.db.dict.E4DBGeneratedClass
e4s.db.dict.E4DBTable
public class E4DBTable
Part of the datadictionary: holds database table information and functionality for modifing tables.
E4DBTableName,
E4DBColumn,
E4DBDatabase,
E4DBView| Field Summary | |
|---|---|
static java.lang.String |
_XML_ATTR_CLIENT
This is an attribute, associated with the _XML_TAG_TABLE tag to specify the table's client distinction status. |
static java.lang.String |
_XML_ATTR_FREEDEF
This is an attribute, associated with the _XML_TAG_TABLE tag to specify the table's client distinction status. |
static java.lang.String |
_XML_ATTR_GENERATE_BASE
This is an attribute, associated with the _XML_TAG_TABLE tag to specify the table's generation status. |
static java.lang.String |
_XML_ATTR_GENERATE_VEC
This is an attribute, associated with the _XML_TAG_TABLE tag to specify the table's generation status. |
static java.lang.String |
_XML_ATTR_PLUGIN_CLASS
|
static java.lang.String |
_XML_ATTR_TABLE_NAME
Used for storing table information in the dictionary XML structure. |
static java.lang.String |
_XML_ATTR_USERDEFINED_CODE_DETECTED
This attribute is just for info, it detectes whenever a user has changed some code. |
static java.lang.String |
_XML_TAG_IDX_ALIAS
Specify the XML tag in the XML file (used for holding the datadictionary information) for the index alias to the table. |
static java.lang.String |
_XML_TAG_TABLE
Used for storing table information in the dictionary XML structure. |
static java.lang.String |
_XML_TAG_TABLE_PLUGIN
|
static java.lang.String |
FUNCTION_NAME_DATABASE_COPY
|
static java.lang.String |
FUNCTION_NAME_DUPLICATE_CLIENT_DATA
|
static java.lang.String |
FUNCTION_NAME_FROM_XML
|
static java.lang.String |
FUNCTION_NAME_REMOVE_CLIENT_DATA
|
static java.lang.String |
FUNCTION_NAME_REMOVE_DATA
|
static java.lang.String |
FUNCTION_NAME_TO_CSV
|
static java.lang.String |
FUNCTION_NAME_TO_SQL
|
static java.lang.String |
FUNCTION_NAME_TO_XML
|
static int |
MAX_INDEXFIELDS_FOR_UNIQUE
Maximum number of index fields for unique index. |
static int |
MAXINDEX
There can be up to MAXINDEX indexes. |
static int |
MAXLEN_TABLE_NAME
Maximum length for a table's name |
| Fields inherited from class e4s.db.dict.E4DBGeneratedClass |
|---|
_XML_ATTR_DEPRECATED, _XML_ATTR_SYSTEM, _XML_TAG_PACKAGE |
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
E4DBTable()
|
|
E4DBTable(E4DBTable table,
E4DBTableName tName)
|
|
E4DBTable(E4DBTableName tablename)
|
|
| Method Summary | |
|---|---|
void |
addColumn(E4DBColumn column)
Add a column (table field) to the table definition. |
void |
addPluginDefinitions(E4DBPluginParams_Intf obj)
|
java.lang.String |
buildStatement_add(E4DBConnection_Intf con,
boolean create,
boolean beautiful,
boolean force_update)
Build either the CREATE TABLE or ALTER TABLE statement. |
void |
buildStatement_createAllIndex(java.util.Vector statements)
|
java.util.Vector |
buildStatement(E4DBConnection_Intf con)
Build a SQL statement to modify the real data dictionary. |
static java.lang.String |
buildStatementCInfo_add(E4DBColumnInfo column,
java.lang.String nvarchar,
java.lang.String ntext)
|
boolean |
canHaveFreeDefinedFields()
Check, if this table might have freedefined fields. |
int |
compareTo(java.lang.Object o)
|
static E4DBColumn |
createClientColumn()
|
void |
DEBUG()
|
boolean |
equals(E4DBTableName tablename)
Compare the table's name. |
E4DBColumn |
findAutoincrement()
Get the column for autoincrement on insert. |
E4DBColumn |
findColumn(E4DBColumnName columnname)
Look for a specific column. |
E4DBColumnInfo |
findColumnInfo(E4DBColumnName columnname)
Look for a specific column. |
E4DBColumn[] |
findColumns(E4DBColumnType columntype)
|
static void |
generateClass_Fields(E4DBJavaGeneratorPrintStream pOut,
E4DBTable_Intf table,
E4DBColumnInfo col,
java.lang.String defined_name,
java.lang.StringBuffer colarr)
|
void |
generateClass()
|
void |
generateRelatedTypes()
|
java.lang.Class |
getClassMod()
|
java.lang.Class |
getClassObj()
|
java.lang.Class |
getClassSel()
|
E4DBColumnInfo[] |
getColumnInfos(boolean sort)
Get all columns |
E4DBColumnsVec |
getColumns()
Get the columns associated with this table. |
E4DBColumn[] |
getColumnsArr()
Get the columns associated with this table. |
void |
getDefinedTypes(java.util.Vector typelist)
|
int |
getFirstUniqueIndex()
Get the number of the first defined index that contains fields and is unique. |
boolean |
getGenerateBase()
Check, if Java source code will be generated for this table. |
boolean |
getGenerateVec()
Check, if Java source code for data vector will be generated for this table. |
java.lang.String |
getIndexAlias(int k)
Get the alias for an index. |
E4DBColumn[] |
getIndexColumns(int idx)
Get the columns for a specified index in their sequence. |
java.lang.String |
getIndexName(int k)
|
java.lang.String |
getIndexName(int k,
boolean use_prefix)
Get the name for an index. |
boolean |
getIndexUnique(int k)
Get the uniqie mode for an index. |
static java.lang.String |
getJavaDatatype(E4DBColumnInfo col)
|
E4DBTableName |
getName()
Get the table's name. |
static java.lang.String |
getNText(E4DBConnection_Intf con)
Depending on the database type, return the format for String datatype. |
int |
getNumberOfColumns()
Get the number of columns. |
static java.lang.String |
getNVarchar(E4DBConnection_Intf con)
Depending on the database type, return the format for String datatype. |
E4DBPluginParams_Intf |
getPluginDefinitions(java.lang.Class plugin)
|
java.util.Vector |
getReference(int status)
Get a Vector of E4DBReference objects. |
java.lang.String |
getRem()
Get the table's remark. |
E4DBTableName |
getTableName()
Get the table's name. |
int |
getUserDefinedCode()
|
boolean |
hasAnyColumns()
Check, if this table has at least one column |
boolean |
hasAnyColumns(int k)
Check, if this table has at least one column defined for specified index |
boolean |
hasChanged()
|
boolean |
hasClientDistinction()
Check, if this table uses client distinction. |
boolean |
hasColumn(E4DBColumnName columnname)
|
static void |
import_Datatypes(E4DBJavaGeneratorPrintStream outA,
E4DBTable_Intf table)
|
boolean |
isIndexDefined(int idx_num)
There is an array [0..MAXINDEX - 1] at each column that defines, if this column is part of this particular index. |
boolean |
isSystemTable()
Is this table an E4S system table? |
void |
refreshIndex()
|
void |
removeClass()
|
boolean |
renameColumn(E4DBTableName tablename,
E4DBColumnName from,
E4DBColumnName to)
|
boolean |
renameTableReferences(E4DBTableName from,
E4DBTableName to)
|
boolean |
renameType(E4DBColumnType oldname,
E4DBColumnType newname)
|
void |
resetChanged()
|
void |
resetIndex(int idx_num)
Exclude all columnsfrom the specified index (= clear index). |
void |
setCanHaveFreeDefinedFields(boolean mode)
Define, if this table might have freedefined fields. |
void |
setClientDistinction(boolean client)
Check, if this table uses client distinction. |
void |
setGenerateBase(boolean generate)
Define, if Java source code shall be generated for this table. |
void |
setGenerateVec(boolean generate)
Define, if Java source code for data vector shall be generated for this table. |
void |
setIndexAlias(java.lang.String alias,
int k)
Define the alias for an index. |
void |
setIndexUnique(boolean unique,
int k)
Define the unique mode for an index. |
void |
setRem(java.lang.String rem)
Define the table's remark. |
void |
setSystemTable(boolean mode)
Internal use of E4S only. |
void |
setTableName(E4DBTableName tablename)
Declare the table's name. |
void |
setTableName(java.lang.String tablename)
Declare the table's name. |
void |
setUserDefinedCode(int modules)
|
void |
synchronize(E4DBConnection_Intf con)
|
void |
synchronize(E4DBConnection_Intf con,
boolean is_new_table)
Synchronize with the real data dictionary. |
java.lang.String |
toString()
|
void |
toXml(E4PrintStream pstr)
Write this table into the XML file (this includes all columns). |
| Methods inherited from class e4s.db.dict.E4DBGeneratedClass |
|---|
_getSVNVersionString, getCreated, getDeprecated, getGenerationOutputPath, getGenerationOutputPath, getModified, getPackage, getPackagePath, getPlugins, isSystem, printGenerateHeader, setCreated, setDeprecated, setHasChanged, setModified, setPackage, setSystem, toXml_Package |
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface e4s.db.dict.E4DBTable_Intf |
|---|
getPackage |
| Field Detail |
|---|
public static final int MAXINDEX
isIndexDefined(int),
resetIndex(int),
E4DBColumn.getIndexSequence(int),
e4s.db.dict.E4DBColumn#setIndex(int),
E4DBColumn.resetIndex(int),
Constant Field Valuespublic static final int MAX_INDEXFIELDS_FOR_UNIQUE
T_E4S_FREEFIELD_VAL_Sel.
public static final int MAXLEN_TABLE_NAME
public static final java.lang.String _XML_TAG_TABLE
E4DBXmlDictionaryHandler,
toXml(e4s.util.E4PrintStream),
Constant Field Valuespublic static final java.lang.String _XML_ATTR_TABLE_NAME
_XML_TAG_TABLE,
toXml(e4s.util.E4PrintStream),
E4DBXmlDictionaryHandler,
Constant Field Valuespublic static final java.lang.String _XML_ATTR_GENERATE_BASE
_XML_TAG_TABLE,
getGenerateBase(),
Constant Field Valuespublic static final java.lang.String _XML_ATTR_GENERATE_VEC
_XML_TAG_TABLE,
getGenerateVec(),
Constant Field Valuespublic static final java.lang.String _XML_TAG_TABLE_PLUGIN
E4DBPluginParams_Intf,
Constant Field Valuespublic static final java.lang.String _XML_ATTR_PLUGIN_CLASS
public static final java.lang.String _XML_ATTR_CLIENT
_XML_TAG_TABLE,
hasClientDistinction(),
E4Client,
Constant Field Valuespublic static final java.lang.String _XML_ATTR_FREEDEF
_XML_TAG_TABLE,
canHaveFreeDefinedFields(),
Constant Field Valuespublic static final java.lang.String _XML_ATTR_USERDEFINED_CODE_DETECTED
E4DBJavaGeneratorPrintStream.hasUserDefinedCode(),
Constant Field Valuespublic static final java.lang.String _XML_TAG_IDX_ALIAS
_XML_TAG_TABLE,
Constant Field Valuespublic static final java.lang.String FUNCTION_NAME_FROM_XML
public static final java.lang.String FUNCTION_NAME_TO_XML
public static final java.lang.String FUNCTION_NAME_TO_CSV
public static final java.lang.String FUNCTION_NAME_TO_SQL
public static final java.lang.String FUNCTION_NAME_REMOVE_DATA
public static final java.lang.String FUNCTION_NAME_REMOVE_CLIENT_DATA
public static final java.lang.String FUNCTION_NAME_DUPLICATE_CLIENT_DATA
public static final java.lang.String FUNCTION_NAME_DATABASE_COPY
| Constructor Detail |
|---|
public E4DBTable(E4DBTableName tablename)
public E4DBTable()
public E4DBTable(E4DBTable table,
E4DBTableName tName)
throws E4DBException
E4DBException| Method Detail |
|---|
public E4DBTableName getTableName()
setTableName(e4s.db.E4DBTableName),
equals(e4s.db.E4DBTableName)public E4DBTableName getName()
E4DBTable_Intf
getName in interface E4DBTable_IntfE4DBTable_Intf.equals(e4s.db.E4DBTableName)public java.lang.String getRem()
getRem in interface E4DBTable_IntfsetRem(String)public void setRem(java.lang.String rem)
rem - table remark, or null if to be clearedgetRem()
public void setIndexAlias(java.lang.String alias,
int k)
alias - the name for this aliask - index number: 0 <= k < MAXINDEXgetIndexAlias(int),
MAXINDEX
public void setIndexUnique(boolean unique,
int k)
unique - true, if this index shall be uniquek - index number: 0 <= k < MAXINDEX#getIndexUniue(int),
setIndexAlias(String,int),
MAXINDEXpublic java.lang.String getIndexAlias(int k)
k - index number: 0 <= k < MAXINDEXsetIndexAlias(String, int),
getIndexName(int),
MAXINDEX
public java.lang.String getIndexName(int k,
boolean use_prefix)
k - index number: 0 <= k < MAXINDEX
getIndexAlias(int),
MAXINDEXpublic java.lang.String getIndexName(int k)
public boolean getIndexUnique(int k)
k - index number: 0 <= k < MAXINDEXsetIndexUnique(boolean, int),
MAXINDEXpublic void addColumn(E4DBColumn column)
column - the column to add.findColumn(e4s.db.E4DBColumnName)public E4DBColumn findColumn(E4DBColumnName columnname)
columnname - the name of the column
public E4DBColumn[] findColumns(E4DBColumnType columntype)
public E4DBColumnInfo findColumnInfo(E4DBColumnName columnname)
E4DBTable_Intf
findColumnInfo in interface E4DBTable_Intfcolumnname - the name of the column
#addColumn(E4DBColumn),
#getColumns()
public void setTableName(E4DBTableName tablename)
throws E4DBException
tablename - name of the table
E4DBExceptiongetTableName(),
setTableName(String)
public void setTableName(java.lang.String tablename)
throws E4DBException
tablename - name of the table
E4DBExceptiongetTableName(),
setTableName(e4s.db.E4DBTableName)public boolean getGenerateBase()
getGenerateBase in interface E4DBTable_IntfsetGenerateBase(boolean)public void setGenerateBase(boolean generate)
generate - true, if generated or false otherwisegetGenerateBase()public boolean getGenerateVec()
setGenerateBase(boolean)public void setGenerateVec(boolean generate)
generate - true, if generated or false otherwisegetGenerateBase()public boolean hasClientDistinction()
hasClientDistinction in interface E4DBTable_IntfsetClientDistinction(boolean),
E4Client,
E4ApplObj_Intfpublic void setClientDistinction(boolean client)
setClientDistinction(boolean),
E4Client,
E4ApplObj_Intfpublic boolean canHaveFreeDefinedFields()
setCanHaveFreeDefinedFields(boolean)public void setCanHaveFreeDefinedFields(boolean mode)
mode - true, if free defined fields are possible for this table in general.canHaveFreeDefinedFields()public E4DBColumnsVec getColumns()
E4DBColumn.findColumn(e4s.db.E4DBColumnName),
addColumn(E4DBColumn),
#getColumns(boolean)public E4DBColumn[] getColumnsArr()
sort - sort the column structure by name
E4DBColumn.findColumn(e4s.db.E4DBColumnName),
addColumn(E4DBColumn)public boolean hasAnyColumns()
public boolean hasAnyColumns(int k)
k - index number
public int getFirstUniqueIndex()
MAXINDEX.public int getNumberOfColumns()
public void toXml(E4PrintStream pstr)
throws java.lang.Exception
pstr - an opened file
java.lang.ExceptionE4DBXmlDictionaryHandler,
_XML_TAG_TABLE,
E4DBColumn.toXml(e4s.util.E4PrintStream)public boolean equals(E4DBTableName tablename)
equals in interface E4DBTable_Intftablename - the tablename to be compared with the table name of this object
E4String.equals(java.lang.String),
setTableName(e4s.db.E4DBTableName),
setTableName(e4s.db.E4DBTableName),
getTableName()
public void synchronize(E4DBConnection_Intf con)
throws E4DBException
E4DBException
public void synchronize(E4DBConnection_Intf con,
boolean is_new_table)
throws E4DBException
con - an open, valid database connectionis_new_table - force creation of columns rather the removing all by synchronizing
E4DBException
public java.util.Vector buildStatement(E4DBConnection_Intf con)
throws E4DBException
con - an open, valid database connection
E4DBExceptionpublic void buildStatement_createAllIndex(java.util.Vector statements)
public E4DBColumn[] getIndexColumns(int idx)
public java.lang.String buildStatement_add(E4DBConnection_Intf con,
boolean create,
boolean beautiful,
boolean force_update)
throws E4DBException
create - true means CREATE TABLE, false means ALTER TABLEbeautiful - if true, output is formatted
E4DBException
public static java.lang.String buildStatementCInfo_add(E4DBColumnInfo column,
java.lang.String nvarchar,
java.lang.String ntext)
throws E4DBException
E4DBExceptionpublic boolean isIndexDefined(int idx_num)
idx_num - the number of the index to look at
E4DBColumn.getIndexSequence(int),
MAXINDEXpublic void resetIndex(int idx_num)
idx_num - the number of the index to be clearedisIndexDefined(int),
e4s.db.dict.E4DBColumn#setIndex(int),
MAXINDEX
public void generateClass()
throws E4DBException
E4DBExceptionpublic void removeClass()
public static void import_Datatypes(E4DBJavaGeneratorPrintStream outA,
E4DBTable_Intf table)
throws java.lang.Exception
java.lang.Exceptionpublic void setUserDefinedCode(int modules)
public java.util.Vector getReference(int status)
E4DBReference objects.
public static void generateClass_Fields(E4DBJavaGeneratorPrintStream pOut,
E4DBTable_Intf table,
E4DBColumnInfo col,
java.lang.String defined_name,
java.lang.StringBuffer colarr)
public static java.lang.String getJavaDatatype(E4DBColumnInfo col)
throws java.lang.Exception
java.lang.Exceptionpublic E4DBColumn findAutoincrement()
public java.lang.String toString()
toString in class E4Objectpublic void DEBUG()
public void getDefinedTypes(java.util.Vector typelist)
public static final E4DBColumn createClientColumn()
throws java.lang.Exception
java.lang.Exceptionpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic boolean isSystemTable()
public void setSystemTable(boolean mode)
isSystemTable()public E4DBColumnInfo[] getColumnInfos(boolean sort)
E4DBTable_Intf
getColumnInfos in interface E4DBTable_Intfpublic static java.lang.String getNVarchar(E4DBConnection_Intf con)
E4DBConnectionDefault._DB_TYPE_MS_ACCESS, otherwise "nvarchar"public static java.lang.String getNText(E4DBConnection_Intf con)
E4DBConnectionDefault._DB_TYPE_MS_ACCESS, otherwise "nvarchar"
public boolean renameType(E4DBColumnType oldname,
E4DBColumnType newname)
public boolean hasColumn(E4DBColumnName columnname)
hasColumn in interface E4DBTable_Intf
public boolean renameTableReferences(E4DBTableName from,
E4DBTableName to)
throws E4DBException
E4DBException
public boolean renameColumn(E4DBTableName tablename,
E4DBColumnName from,
E4DBColumnName to)
throws E4DBException
E4DBException
public java.lang.Class getClassMod()
throws E4DBException,
java.lang.ClassNotFoundException
E4DBException
java.lang.ClassNotFoundException
public java.lang.Class getClassSel()
throws E4DBException,
java.lang.ClassNotFoundException
E4DBException
java.lang.ClassNotFoundException
public java.lang.Class getClassObj()
throws E4DBException,
java.lang.ClassNotFoundException
E4DBException
java.lang.ClassNotFoundException
public void refreshIndex()
throws java.lang.Exception
java.lang.Exceptionpublic void resetChanged()
resetChanged in class E4DBGeneratedClasspublic boolean hasChanged()
hasChanged in interface E4DBTable_IntfhasChanged in class E4DBGeneratedClasspublic int getUserDefinedCode()
public void addPluginDefinitions(E4DBPluginParams_Intf obj)
public E4DBPluginParams_Intf getPluginDefinitions(java.lang.Class plugin)
public void generateRelatedTypes()
throws E4DBException
E4DBException
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||