www.element4solution.com

e4s.db.dict
Class E4DBDatabase

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.db.dict.E4DBDatabase

public class E4DBDatabase
extends E4Object

Part of the datadictionary: holds information of all the database tables.

Since:
JDK 1.4
See Also:
E4DBTable

Field Summary
static java.lang.String XML_TAG_DATABASE
           
static java.lang.String XML_TAG_TABLES
           
static java.lang.String XML_TAG_VIEWS
           
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4DBDatabase()
           
 
Method Summary
static java.lang.String _getSVNVersionString()
           
 void addTable(E4DBTable table)
           
 void addView(E4DBView view)
           
 void DEBUG()
           
 E4DBTable findTable(E4DBTableName tablename)
           
 E4DBTable_Intf findTableOrView(E4DBTableName tablename)
           
 E4DBView findView(E4DBTableName tablename)
           
 void generate()
           
 java.lang.String[] getAllTablePackages()
          Get a vector of E4DBTable elements.
 java.lang.String[] getAllViewPackages()
           
 E4DBTable[] getTables()
          Get an array of E4DBTable elements.
 E4DBTable[] getTables(boolean sys_tables, boolean app_tables)
          Get an array of E4DBTable elements.
 E4DBTable[] getTables(java.lang.String packageName)
           
 E4DBTable[] getTables(java.lang.String packageName, boolean sys_tables, boolean app_tables)
           
 E4DBView[] getViews(boolean sort)
          Get a vector of E4DBTable elements.
 E4DBView[] getViews(java.lang.String packg, boolean sort)
          Get a vector of E4DBTable elements.
 boolean hasTables(java.lang.String sPackage)
           
 boolean hasTables(java.lang.String sPackage, boolean check_system)
           
 boolean hasViews(java.lang.String sPackage)
           
 boolean hasViews(java.lang.String sPackage, boolean check_system)
           
static boolean isReservedName(java.lang.String name)
          Check, if a name is a reserved SQL keyword.
 void removeTable(E4DBTableName tablename)
           
 void removeView(E4DBTableName viewname)
           
 int size()
           
 E4SelectValues tableSelection(boolean add_blank)
           
 boolean toXmlTables(java.lang.String sPackage, E4PrintStream pstr)
          Writs the current database object into the given XML stream.
 boolean toXmlViews(java.lang.String sPackage, E4PrintStream pstr)
          Writs the current database object into the given XML stream.
 E4SelectValues viewSelection(boolean add_blank)
           
 
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, toString, 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
 

Field Detail

XML_TAG_DATABASE

public static java.lang.String XML_TAG_DATABASE

XML_TAG_TABLES

public static java.lang.String XML_TAG_TABLES

XML_TAG_VIEWS

public static java.lang.String XML_TAG_VIEWS
Constructor Detail

E4DBDatabase

public E4DBDatabase()
Method Detail

addTable

public void addTable(E4DBTable table)

addView

public void addView(E4DBView view)

removeTable

public void removeTable(E4DBTableName tablename)

removeView

public void removeView(E4DBTableName viewname)

findTableOrView

public E4DBTable_Intf findTableOrView(E4DBTableName tablename)

findView

public E4DBView findView(E4DBTableName tablename)
                  throws E4DBException
Throws:
E4DBException

findTable

public E4DBTable findTable(E4DBTableName tablename)
                    throws E4DBException
Throws:
E4DBException

toXmlTables

public boolean toXmlTables(java.lang.String sPackage,
                           E4PrintStream pstr)
                    throws java.lang.Exception
Writs the current database object into the given XML stream.

Parameters:
pstr - a stream, opened in write mode
Throws:
java.lang.Exception
See Also:
E4DBDict.readDictionary()

toXmlViews

public boolean toXmlViews(java.lang.String sPackage,
                          E4PrintStream pstr)
                   throws java.lang.Exception
Writs the current database object into the given XML stream.

Parameters:
pstr - a stream, opened in write mode
Throws:
java.lang.Exception
See Also:
E4DBDict.readDictionary()

isReservedName

public static boolean isReservedName(java.lang.String name)
Check, if a name is a reserved SQL keyword.

Parameters:
name - the string to be checked (tablenames, columnnames)
Returns:
true if name is a reserved keyowrd (e.g. "ALTER").
See Also:
E4DBTypes.isReservedName(String)

getAllTablePackages

public java.lang.String[] getAllTablePackages()
                                       throws E4DBException
Get a vector of E4DBTable elements.

Returns:
an Enumeration of related tables objects
Throws:
E4DBException

getAllViewPackages

public java.lang.String[] getAllViewPackages()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getTables

public E4DBTable[] getTables()
                      throws E4DBException
Get an array of E4DBTable elements.

Returns:
an Enumeration of related tables objects
Throws:
E4DBException

getTables

public E4DBTable[] getTables(boolean sys_tables,
                             boolean app_tables)
                      throws E4DBException
Get an array of E4DBTable elements.

Returns:
an Enumeration of related tables objects
Throws:
E4DBException

getTables

public E4DBTable[] getTables(java.lang.String packageName)
                      throws E4DBException
Throws:
E4DBException

getTables

public E4DBTable[] getTables(java.lang.String packageName,
                             boolean sys_tables,
                             boolean app_tables)
                      throws E4DBException
Throws:
E4DBException

getViews

public E4DBView[] getViews(boolean sort)
                    throws E4DBException
Get a vector of E4DBTable elements.

Returns:
an Enumeration of related tables objects
Throws:
E4DBException

getViews

public E4DBView[] getViews(java.lang.String packg,
                           boolean sort)
                    throws E4DBException
Get a vector of E4DBTable elements.

Parameters:
packg - null all packages or any package
sort - sort the results
Returns:
an array of view objects
Throws:
E4DBException

generate

public void generate()
              throws E4DBException
Throws:
E4DBException

size

public int size()

tableSelection

public E4SelectValues tableSelection(boolean add_blank)
                              throws E4DBException
Throws:
E4DBException

viewSelection

public E4SelectValues viewSelection(boolean add_blank)
                             throws E4DBException
Throws:
E4DBException

DEBUG

public void DEBUG()

hasViews

public boolean hasViews(java.lang.String sPackage)
                 throws E4DBException
Throws:
E4DBException

hasViews

public boolean hasViews(java.lang.String sPackage,
                        boolean check_system)
                 throws E4DBException
Throws:
E4DBException

hasTables

public boolean hasTables(java.lang.String sPackage)
                  throws E4DBException
Throws:
E4DBException

hasTables

public boolean hasTables(java.lang.String sPackage,
                         boolean check_system)
                  throws E4DBException
Throws:
E4DBException

_getSVNVersionString

public static java.lang.String _getSVNVersionString()

www.element4solution.com