www.element4solution.com

e4s.db.dict
Class E4DBTable

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.db.dict.E4DBGeneratedClass
          extended by e4s.db.dict.E4DBTable
All Implemented Interfaces:
E4DBTable_Intf, java.lang.Comparable

public class E4DBTable
extends E4DBGeneratedClass
implements E4DBTable_Intf, java.lang.Comparable

Part of the datadictionary: holds database table information and functionality for modifing tables.

Since:
JDK 1.4
See Also:
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

MAXINDEX

public static final int MAXINDEX
There can be up to MAXINDEX indexes. An index doesn't have a name, either detailed parameters - just a number between 0 and MAXINDEX - 1. It is defined at each E4DBColumn, if this column is part of the index.

See Also:
isIndexDefined(int), resetIndex(int), E4DBColumn.getIndexSequence(int), e4s.db.dict.E4DBColumn#setIndex(int), E4DBColumn.resetIndex(int), Constant Field Values

MAX_INDEXFIELDS_FOR_UNIQUE

public static final int MAX_INDEXFIELDS_FOR_UNIQUE
Maximum number of index fields for unique index. Note: a change here requires a database change in T_E4S_FREEFIELD_VAL_Sel.

See Also:
Constant Field Values

MAXLEN_TABLE_NAME

public static final int MAXLEN_TABLE_NAME
Maximum length for a table's name

See Also:
Constant Field Values

_XML_TAG_TABLE

public static final java.lang.String _XML_TAG_TABLE
Used for storing table information in the dictionary XML structure. Specify the main XML tag in the XML file (used for holding the datadictionary information) for the main table entry.

See Also:
E4DBXmlDictionaryHandler, toXml(e4s.util.E4PrintStream), Constant Field Values

_XML_ATTR_TABLE_NAME

public static final java.lang.String _XML_ATTR_TABLE_NAME
Used for storing table information in the dictionary XML structure. This is an attribute, associated with the _XML_TAG_TABLE tag to specify the table's name.

See Also:
_XML_TAG_TABLE, toXml(e4s.util.E4PrintStream), E4DBXmlDictionaryHandler, Constant Field Values

_XML_ATTR_GENERATE_BASE

public static final 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. To generate means, creating Java source code for data access.

See Also:
_XML_TAG_TABLE, getGenerateBase(), Constant Field Values

_XML_ATTR_GENERATE_VEC

public static final 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. To generate means, creating Java source code for data access.

See Also:
_XML_TAG_TABLE, getGenerateVec(), Constant Field Values

_XML_TAG_TABLE_PLUGIN

public static final java.lang.String _XML_TAG_TABLE_PLUGIN
See Also:
E4DBPluginParams_Intf, Constant Field Values

_XML_ATTR_PLUGIN_CLASS

public static final java.lang.String _XML_ATTR_PLUGIN_CLASS
See Also:
Constant Field Values

_XML_ATTR_CLIENT

public static final 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.

See Also:
_XML_TAG_TABLE, hasClientDistinction(), E4Client, Constant Field Values

_XML_ATTR_FREEDEF

public static final 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.

See Also:
_XML_TAG_TABLE, canHaveFreeDefinedFields(), Constant Field Values

_XML_ATTR_USERDEFINED_CODE_DETECTED

public static final java.lang.String _XML_ATTR_USERDEFINED_CODE_DETECTED
This attribute is just for info, it detectes whenever a user has changed some code.

See Also:
E4DBJavaGeneratorPrintStream.hasUserDefinedCode(), Constant Field Values

_XML_TAG_IDX_ALIAS

public static final 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.

See Also:
_XML_TAG_TABLE, Constant Field Values

FUNCTION_NAME_FROM_XML

public static final java.lang.String FUNCTION_NAME_FROM_XML
See Also:
Constant Field Values

FUNCTION_NAME_TO_XML

public static final java.lang.String FUNCTION_NAME_TO_XML
See Also:
Constant Field Values

FUNCTION_NAME_TO_CSV

public static final java.lang.String FUNCTION_NAME_TO_CSV
See Also:
Constant Field Values

FUNCTION_NAME_TO_SQL

public static final java.lang.String FUNCTION_NAME_TO_SQL
See Also:
Constant Field Values

FUNCTION_NAME_REMOVE_DATA

public static final java.lang.String FUNCTION_NAME_REMOVE_DATA
See Also:
Constant Field Values

FUNCTION_NAME_REMOVE_CLIENT_DATA

public static final java.lang.String FUNCTION_NAME_REMOVE_CLIENT_DATA
See Also:
Constant Field Values

FUNCTION_NAME_DUPLICATE_CLIENT_DATA

public static final java.lang.String FUNCTION_NAME_DUPLICATE_CLIENT_DATA
See Also:
Constant Field Values

FUNCTION_NAME_DATABASE_COPY

public static final java.lang.String FUNCTION_NAME_DATABASE_COPY
See Also:
Constant Field Values
Constructor Detail

E4DBTable

public E4DBTable(E4DBTableName tablename)

E4DBTable

public E4DBTable()

E4DBTable

public E4DBTable(E4DBTable table,
                 E4DBTableName tName)
          throws E4DBException
Throws:
E4DBException
Method Detail

getTableName

public E4DBTableName getTableName()
Get the table's name.

Returns:
name of the table
See Also:
setTableName(e4s.db.E4DBTableName), equals(e4s.db.E4DBTableName)

getName

public E4DBTableName getName()
Description copied from interface: E4DBTable_Intf
Get the table's name.

Specified by:
getName in interface E4DBTable_Intf
Returns:
name of the table
See Also:
E4DBTable_Intf.equals(e4s.db.E4DBTableName)

getRem

public java.lang.String getRem()
Get the table's remark.

Specified by:
getRem in interface E4DBTable_Intf
Returns:
table remark, or null if not defined
See Also:
setRem(String)

setRem

public void setRem(java.lang.String rem)
Define the table's remark.

Parameters:
rem - table remark, or null if to be cleared
See Also:
getRem()

setIndexAlias

public void setIndexAlias(java.lang.String alias,
                          int k)
Define the alias for an index. This is used later for faster and direct access to database records, by generation process.

Parameters:
alias - the name for this alias
k - index number: 0 <= k < MAXINDEX
See Also:
getIndexAlias(int), MAXINDEX

setIndexUnique

public void setIndexUnique(boolean unique,
                           int k)
Define the unique mode for an index.

Parameters:
unique - true, if this index shall be unique
k - index number: 0 <= k < MAXINDEX
See Also:
#getIndexUniue(int), setIndexAlias(String,int), MAXINDEX

getIndexAlias

public java.lang.String getIndexAlias(int k)
Get the alias for an index. This is used later for faster and direct access to database records, by generation process.

Parameters:
k - index number: 0 <= k < MAXINDEX
See Also:
setIndexAlias(String, int), getIndexName(int), MAXINDEX

getIndexName

public java.lang.String getIndexName(int k,
                                     boolean use_prefix)
Get the name for an index.

Parameters:
k - index number: 0 <= k < MAXINDEX
Returns:
the alias name of that index or a generic name (IDX3)
See Also:
getIndexAlias(int), MAXINDEX

getIndexName

public java.lang.String getIndexName(int k)

getIndexUnique

public boolean getIndexUnique(int k)
Get the uniqie mode for an index.

Parameters:
k - index number: 0 <= k < MAXINDEX
See Also:
setIndexUnique(boolean, int), MAXINDEX

addColumn

public void addColumn(E4DBColumn column)
Add a column (table field) to the table definition.

Parameters:
column - the column to add.
See Also:
findColumn(e4s.db.E4DBColumnName)

findColumn

public E4DBColumn findColumn(E4DBColumnName columnname)
Look for a specific column.

Parameters:
columnname - the name of the column
Returns:
null if not found, the column if found

findColumns

public E4DBColumn[] findColumns(E4DBColumnType columntype)

findColumnInfo

public E4DBColumnInfo findColumnInfo(E4DBColumnName columnname)
Description copied from interface: E4DBTable_Intf
Look for a specific column.

Specified by:
findColumnInfo in interface E4DBTable_Intf
Parameters:
columnname - the name of the column
Returns:
null if not found, the column if found
See Also:
#addColumn(E4DBColumn), #getColumns()

setTableName

public void setTableName(E4DBTableName tablename)
                  throws E4DBException
Declare the table's name.

Parameters:
tablename - name of the table
Throws:
E4DBException
See Also:
getTableName(), setTableName(String)

setTableName

public void setTableName(java.lang.String tablename)
                  throws E4DBException
Declare the table's name.

Parameters:
tablename - name of the table
Throws:
E4DBException
See Also:
getTableName(), setTableName(e4s.db.E4DBTableName)

getGenerateBase

public boolean getGenerateBase()
Check, if Java source code will be generated for this table.

Specified by:
getGenerateBase in interface E4DBTable_Intf
Returns:
true, if generated or false otherwise
See Also:
setGenerateBase(boolean)

setGenerateBase

public void setGenerateBase(boolean generate)
Define, if Java source code shall be generated for this table.

Parameters:
generate - true, if generated or false otherwise
See Also:
getGenerateBase()

getGenerateVec

public boolean getGenerateVec()
Check, if Java source code for data vector will be generated for this table.

Returns:
true, if generated or false otherwise
See Also:
setGenerateBase(boolean)

setGenerateVec

public void setGenerateVec(boolean generate)
Define, if Java source code for data vector shall be generated for this table.

Parameters:
generate - true, if generated or false otherwise
See Also:
getGenerateBase()

hasClientDistinction

public boolean hasClientDistinction()
Check, if this table uses client distinction.

Specified by:
hasClientDistinction in interface E4DBTable_Intf
Returns:
true, if client destinction will be used
See Also:
setClientDistinction(boolean), E4Client, E4ApplObj_Intf

setClientDistinction

public void setClientDistinction(boolean client)
Check, if this table uses client distinction.

See Also:
setClientDistinction(boolean), E4Client, E4ApplObj_Intf

canHaveFreeDefinedFields

public boolean canHaveFreeDefinedFields()
Check, if this table might have freedefined fields.

Returns:
true, if free defined fields are possible for this table in general.
See Also:
setCanHaveFreeDefinedFields(boolean)

setCanHaveFreeDefinedFields

public void setCanHaveFreeDefinedFields(boolean mode)
Define, if this table might have freedefined fields.

Parameters:
mode - true, if free defined fields are possible for this table in general.
See Also:
canHaveFreeDefinedFields()

getColumns

public E4DBColumnsVec getColumns()
Get the columns associated with this table.

Returns:
null if no columns defined, or an Enumeration representing the column Vector. The elements are of type E4DBColumn.
See Also:
findColumn(e4s.db.E4DBColumnName), addColumn(E4DBColumn), #getColumns(boolean)

getColumnsArr

public E4DBColumn[] getColumnsArr()
Get the columns associated with this table.

Parameters:
sort - sort the column structure by name
Returns:
null if no columns defined, or an Enumeration representing the column Vector. The elements are of type E4DBColumn.
See Also:
findColumn(e4s.db.E4DBColumnName), addColumn(E4DBColumn)

hasAnyColumns

public boolean hasAnyColumns()
Check, if this table has at least one column

Returns:
true if at least one column is defined

hasAnyColumns

public boolean hasAnyColumns(int k)
Check, if this table has at least one column defined for specified index

Parameters:
k - index number
Returns:
true if at least one column is defined

getFirstUniqueIndex

public int getFirstUniqueIndex()
Get the number of the first defined index that contains fields and is unique.

Returns:
-1 if no unique index is defined (or empty columns) or the number of the index which is between 0 and MAXINDEX.

getNumberOfColumns

public int getNumberOfColumns()
Get the number of columns.

Returns:
the number of columns

toXml

public void toXml(E4PrintStream pstr)
           throws java.lang.Exception
Write this table into the XML file (this includes all columns).

Parameters:
pstr - an opened file
Throws:
java.lang.Exception
See Also:
E4DBXmlDictionaryHandler, _XML_TAG_TABLE, E4DBColumn.toXml(e4s.util.E4PrintStream)

equals

public boolean equals(E4DBTableName tablename)
Compare the table's name.

Specified by:
equals in interface E4DBTable_Intf
Parameters:
tablename - the tablename to be compared with the table name of this object
Returns:
true, if equal
See Also:
E4String.equals(java.lang.String), setTableName(e4s.db.E4DBTableName), setTableName(e4s.db.E4DBTableName), getTableName()

synchronize

public void synchronize(E4DBConnection_Intf con)
                 throws E4DBException
Throws:
E4DBException

synchronize

public void synchronize(E4DBConnection_Intf con,
                        boolean is_new_table)
                 throws E4DBException
Synchronize with the real data dictionary.

Parameters:
con - an open, valid database connection
is_new_table - force creation of columns rather the removing all by synchronizing
Throws:
E4DBException

buildStatement

public java.util.Vector buildStatement(E4DBConnection_Intf con)
                                throws E4DBException
Build a SQL statement to modify the real data dictionary. First, a synchronize() is performed to check the inconsistency between the real dictionary and the metaschema.

Parameters:
con - an open, valid database connection
Returns:
a SQL statement, e.g. "alter table person add age integer, name nvarchar(20)"
Throws:
E4DBException

buildStatement_createAllIndex

public void buildStatement_createAllIndex(java.util.Vector statements)

getIndexColumns

public E4DBColumn[] getIndexColumns(int idx)
Get the columns for a specified index in their sequence.


buildStatement_add

public java.lang.String buildStatement_add(E4DBConnection_Intf con,
                                           boolean create,
                                           boolean beautiful,
                                           boolean force_update)
                                    throws E4DBException
Build either the CREATE TABLE or ALTER TABLE statement.

Parameters:
create - true means CREATE TABLE, false means ALTER TABLE
beautiful - if true, output is formatted
Throws:
E4DBException

buildStatementCInfo_add

public static java.lang.String buildStatementCInfo_add(E4DBColumnInfo column,
                                                       java.lang.String nvarchar,
                                                       java.lang.String ntext)
                                                throws E4DBException
Throws:
E4DBException

isIndexDefined

public 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. Index is numbered 0 to MAXINDEX - 1.

Parameters:
idx_num - the number of the index to look at
Returns:
true, if at least one column is part of this index. false otherwise, or if the parameter is out of range.
See Also:
E4DBColumn.getIndexSequence(int), MAXINDEX

resetIndex

public void resetIndex(int idx_num)
Exclude all columnsfrom the specified index (= clear index). There is an array [0..MAXINDEX - 1] at each column that defines, if this column is part of this particular index. Index is numbered 0 to MAXINDEX - 1.

Parameters:
idx_num - the number of the index to be cleared
See Also:
isIndexDefined(int), e4s.db.dict.E4DBColumn#setIndex(int), MAXINDEX

generateClass

public void generateClass()
                   throws E4DBException
Throws:
E4DBException

removeClass

public void removeClass()

import_Datatypes

public static void import_Datatypes(E4DBJavaGeneratorPrintStream outA,
                                    E4DBTable_Intf table)
                             throws java.lang.Exception
Throws:
java.lang.Exception

setUserDefinedCode

public void setUserDefinedCode(int modules)

getReference

public java.util.Vector getReference(int status)
Get a Vector of E4DBReference objects.

Returns:
the Vector

generateClass_Fields

public static void generateClass_Fields(E4DBJavaGeneratorPrintStream pOut,
                                        E4DBTable_Intf table,
                                        E4DBColumnInfo col,
                                        java.lang.String defined_name,
                                        java.lang.StringBuffer colarr)

getJavaDatatype

public static java.lang.String getJavaDatatype(E4DBColumnInfo col)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

findAutoincrement

public E4DBColumn findAutoincrement()
Get the column for autoincrement on insert.

Returns:
null if no column is defined or the column for insert-incremental.

toString

public java.lang.String toString()
Overrides:
toString in class E4Object

DEBUG

public void DEBUG()

getDefinedTypes

public void getDefinedTypes(java.util.Vector typelist)

createClientColumn

public static final E4DBColumn createClientColumn()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

isSystemTable

public boolean isSystemTable()
Is this table an E4S system table?

Returns:
true if this table is an E4S system table, which means that it cannot be changed within an application but it must exist within an application.

setSystemTable

public void setSystemTable(boolean mode)
Internal use of E4S only.

See Also:
isSystemTable()

getColumnInfos

public E4DBColumnInfo[] getColumnInfos(boolean sort)
Description copied from interface: E4DBTable_Intf
Get all columns

Specified by:
getColumnInfos in interface E4DBTable_Intf

getNVarchar

public static java.lang.String getNVarchar(E4DBConnection_Intf con)
Depending on the database type, return the format for String datatype.

Returns:
"varchar" if E4DBConnectionDefault._DB_TYPE_MS_ACCESS, otherwise "nvarchar"

getNText

public static java.lang.String getNText(E4DBConnection_Intf con)
Depending on the database type, return the format for String datatype.

Returns:
"varchar" if E4DBConnectionDefault._DB_TYPE_MS_ACCESS, otherwise "nvarchar"

renameType

public boolean renameType(E4DBColumnType oldname,
                          E4DBColumnType newname)

hasColumn

public boolean hasColumn(E4DBColumnName columnname)
Specified by:
hasColumn in interface E4DBTable_Intf

renameTableReferences

public boolean renameTableReferences(E4DBTableName from,
                                     E4DBTableName to)
                              throws E4DBException
Throws:
E4DBException

renameColumn

public boolean renameColumn(E4DBTableName tablename,
                            E4DBColumnName from,
                            E4DBColumnName to)
                     throws E4DBException
Throws:
E4DBException

getClassMod

public java.lang.Class getClassMod()
                            throws E4DBException,
                                   java.lang.ClassNotFoundException
Throws:
E4DBException
java.lang.ClassNotFoundException

getClassSel

public java.lang.Class getClassSel()
                            throws E4DBException,
                                   java.lang.ClassNotFoundException
Throws:
E4DBException
java.lang.ClassNotFoundException

getClassObj

public java.lang.Class getClassObj()
                            throws E4DBException,
                                   java.lang.ClassNotFoundException
Throws:
E4DBException
java.lang.ClassNotFoundException

refreshIndex

public void refreshIndex()
                  throws java.lang.Exception
Throws:
java.lang.Exception

resetChanged

public void resetChanged()
Overrides:
resetChanged in class E4DBGeneratedClass

hasChanged

public boolean hasChanged()
Specified by:
hasChanged in interface E4DBTable_Intf
Overrides:
hasChanged in class E4DBGeneratedClass

getUserDefinedCode

public int getUserDefinedCode()

addPluginDefinitions

public void addPluginDefinitions(E4DBPluginParams_Intf obj)

getPluginDefinitions

public E4DBPluginParams_Intf getPluginDefinitions(java.lang.Class plugin)

generateRelatedTypes

public void generateRelatedTypes()
                          throws E4DBException
Throws:
E4DBException

www.element4solution.com