|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.core.ProperObject
proper.database.ConnectorObject
proper.database.RelationDiscoverer
public class RelationDiscoverer
This class discovers from a table all the tables that are dependent on it, i.e. whether other tables have the same index-names. Unfortunately does the MySQL jdbc-driver not support foreign key relations, s.t. we'll have to work on column names. From a given table as starting point it determines from this table's indexes all the other tables that reference these indexes. The result is a tree structure of related tables, where the UserObject in the nodes contains a Table-Object. E.g. the east-west-challenge looks then like this:
train |-car | |-load
Join
Field Summary |
---|
Fields inherited from interface proper.core.ProperInterface |
---|
VERSION |
Constructor Summary | |
---|---|
RelationDiscoverer(Connector conn)
initializes the object |
Method Summary | |
---|---|
JoinTreeNode |
discover()
discovers the relation between the tables in the given database and returns the root element of the built tree |
java.util.Vector |
getExcludes()
returns the tables excluded from discovery |
int |
getMaxDepth()
returns the current maximal depth to search |
java.lang.String |
getTable()
returns the name of the table to read from |
boolean |
getUseForeignKeys()
returns whether foreign keys are used for discovering relations between tables or only matching column names |
java.util.Vector |
leftOverTables()
returns all the tables that are not in this tree |
java.util.Vector |
leftOverTables(JoinTreeNode root)
returns all the tables that are not in this tree |
void |
setExcludes(java.lang.String excludes)
sets the tables (String) to exclude from discovery |
void |
setExcludes(java.util.Vector excludes)
sets the tables (String) to exclude from discovery |
void |
setMaxDepth(int maxDepth)
sets the maximal depth of the tree to search, -1 means no limit |
void |
setTable(java.lang.String table)
sets the name of the table to use |
void |
setUseForeignKeys(boolean useForeignKeys)
whether to use foreign keys or matching column names for discovering table relations |
java.lang.String |
toString()
the object in a string representation |
Methods inherited from class proper.database.ConnectorObject |
---|
getConnector |
Methods inherited from class proper.core.ProperObject |
---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RelationDiscoverer(Connector conn)
Method Detail |
---|
public void setTable(java.lang.String table)
public java.lang.String getTable()
public void setExcludes(java.util.Vector excludes)
public void setExcludes(java.lang.String excludes)
public java.util.Vector getExcludes()
public void setMaxDepth(int maxDepth)
public int getMaxDepth()
public void setUseForeignKeys(boolean useForeignKeys)
useForeignKeys
- whether to use foreign keys or matching
column namespublic boolean getUseForeignKeys()
public JoinTreeNode discover()
public java.util.Vector leftOverTables()
public java.util.Vector leftOverTables(JoinTreeNode root)
root
- the generated tree from a previous run
public java.lang.String toString()
toString
in class ProperObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |