public class DBTableDef
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.Hashtable<java.lang.String,java.util.Properties> |
cacheFKByColumn
The foreign key data provided by the
DatabaseMetaData.getImportedKeys() method. |
java.util.Vector<java.lang.String> |
fkProps
The order of foreign keys represented by column names.
|
java.util.Properties |
tableProps
The table meta data provided by the
DatabaseMetaData.getTables() method. |
Constructor and Description |
---|
DBTableDef()
Constructor method for i18n purposes only.
|
DBTableDef(java.util.Properties props)
Init functionality.
|
Modifier and Type | Method and Description |
---|---|
void |
addForeignKey(java.util.Properties fkprops)
Add foreign key data provided by the
DatabaseMetaData.getImportedKeys() method. |
static DBTableDef |
createFromMetadata(java.sql.DatabaseMetaData metadata,
java.sql.ResultSet rs)
Creates a new
DBTableDef instance from database meta data. |
static java.lang.String |
createTableID(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Generates the unique table identifier.
|
boolean |
equals(DBTableDef tocheck)
Checks wether a given
DBTableDef instance is equal to this. |
protected void |
finalize()
Helps the garbage collector.
|
java.lang.String |
getCatalog()
Provides the catalog of the table.
|
java.lang.String[] |
getFKColumns()
Provides the list of columns with foreign key relations.
|
java.lang.String |
getSchema()
Provides the schema of the table.
|
java.lang.String |
getTable()
Provides the name of the table.
|
java.lang.String |
toString()
Overrides method
java.lang.Object.toString . |
public java.util.Properties tableProps
DatabaseMetaData.getTables()
method.public java.util.Hashtable<java.lang.String,java.util.Properties> cacheFKByColumn
DatabaseMetaData.getImportedKeys()
method.public java.util.Vector<java.lang.String> fkProps
public DBTableDef() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic DBTableDef(java.util.Properties props)
props
- The table meta datajava.lang.NullPointerException
- If a parameter is null
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void addForeignKey(java.util.Properties fkprops)
DatabaseMetaData.getImportedKeys()
method.
fkprops
- The foreign key datajava.lang.NullPointerException
- If a parameter is null
public java.lang.String toString()
java.lang.Object.toString
.
toString
in class java.lang.Object
public static java.lang.String createTableID(java.lang.String catalog, java.lang.String schema, java.lang.String table)
catalog
- The table catalog (optional)schema
- The table schema (optional)table
- The table namepublic boolean equals(DBTableDef tocheck)
DBTableDef
instance is equal to this.
tocheck
- Instance to be checkedDBTableDef
instance to check for equalitypublic java.lang.String getCatalog()
null
public java.lang.String getSchema()
null
public java.lang.String getTable()
null
public java.lang.String[] getFKColumns()
public static DBTableDef createFromMetadata(java.sql.DatabaseMetaData metadata, java.sql.ResultSet rs)
DBTableDef
instance from database meta data.
The result set is never closed. Call the DatabaseMetaData.getTables()
method
for the tables you like to be processed and pass the open result set pointing to the
next table dataset to be converted to a DBTableDef
object.
metadata
- The database meta datars
- The result set from DatabaseMetaData.getTables()
null
as error indicationjava.lang.NullPointerException
- If parameters are invalidjava.lang.IllegalArgumentException
- If parameters are invalidCopyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.