proper.engine
Class Flattener

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.engine.Engine
          extended by proper.engine.DatabaseEngine
              extended by proper.engine.Flattener
All Implemented Interfaces:
ProperInterface

public class Flattener
extends DatabaseEngine

This class flattens a given relational database into one table. It uses the class RelationDiscoverer to determine the relations between the tables given a table as starting point. From the generated tree structure it subsequently joins the leaves of a node with the node itself. The joining is always optimized regarding size, i.e. the joins are ordered in such a way that the small tables are joined first, before the larger ones.

Version:
$Revision: 1.5 $
Author:
FracPete
See Also:
RelationDiscoverer

Field Summary
static java.lang.String TMPPREFIX
          prefix for temporary tables
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
Flattener()
          initializes the object
 
Method Summary
 boolean execute()
          executes the flattening of the tables
 boolean getShowRelations()
          whether the relations between the tables are shown before flattening
 TemporaryName getTemporaryName()
          returns the temporary name generator
 void setShowRelations(boolean showRelations)
          whether to display the relations before flattening or not
 void setTemporaryName(TemporaryName tmpName)
          sets the generator for temporary names
 
Methods inherited from class proper.engine.Engine
clear, copyParameter, exists, getParameter, getParameters, getStringParameter, setParameter, setParameters, toString, valueEquals
 
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
 

Field Detail

TMPPREFIX

public static final java.lang.String TMPPREFIX
prefix for temporary tables

See Also:
Constant Field Values
Constructor Detail

Flattener

public Flattener()
initializes the object

Method Detail

setTemporaryName

public void setTemporaryName(TemporaryName tmpName)
sets the generator for temporary names


getTemporaryName

public TemporaryName getTemporaryName()
returns the temporary name generator


setShowRelations

public void setShowRelations(boolean showRelations)
whether to display the relations before flattening or not


getShowRelations

public boolean getShowRelations()
whether the relations between the tables are shown before flattening


execute

public boolean execute()
executes the flattening of the tables

Overrides:
execute in class Engine