easik.sketch.util.Export.Constraints
Class ExportConstraint

java.lang.Object
  extended by easik.sketch.util.Export.Constraints.ExportConstraint
Direct Known Subclasses:
ExportCommutativeDiagram, ExportProductConstraint, ExportPullback, ExportSumConstraint

public class ExportConstraint
extends java.lang.Object

General class to hold a constraint generated directly from the XML file. Constraints are never formed directly from this class, thus the type of constraint is determined by the creating subclass. Should not be used for any other purpose than database exportation, as it contains no graphical information.

Since:
2006-05-22 Vera Ranieri
Version:
2006-07-07 Vera Ranieri
Author:
Vera Ranieri 2006

Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.String> _a_i_tables
          HashMap of all procedures that are called AFTER INSERT, indexed by the table that it applies to
protected  java.util.HashMap<java.lang.String,java.lang.String> _b_d_tables
          HashMap of all procedures that are calledBEFORE DELETE, indexed by the table that it applies to
protected  java.util.HashMap<java.lang.String,java.lang.String> _b_i_tables
          HashMap of all procedures that are called BEFORE INSERT, indexed by the table that it applies to
protected  java.lang.String _baseTable
          The base table of the constraint
protected  java.lang.String _db_name
          The database name
protected  int _id
          A unique identifier of the constraint
protected  java.util.ArrayList<ExportPath> _paths
          The paths involved in this constraint
protected  java.util.ArrayList<java.lang.String> _procedureStrings
          The procedures created by the constraint
 
Constructor Summary
ExportConstraint()
          Constructs a new contraint for exportation.
 
Method Summary
 void addPath(ExportPath p)
          Add a path to this constraint.
 java.lang.String getBaseTable()
          The table that serves as a base for the constraint.
 java.util.ArrayList<java.lang.String> getConstraintStrings()
          Gets the constraint string for this constraint.
 java.util.ArrayList<ExportPath> getPaths()
          Get all paths participating in this constraint
 java.util.HashMap<java.lang.String,java.lang.String> getTimeNames(java.lang.String time)
          Gets the hash map containing all procedures to be called at time.
 void set_db_name(java.lang.String db_name)
          Sets the database name
 void setBaseTable()
          Sets the base table for the constraint.
 void setConstraintStrings()
          Sets the constraint string for this constraint.
 void setTargetTable()
          Sets the target table(s) for the constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_paths

protected java.util.ArrayList<ExportPath> _paths
The paths involved in this constraint


_procedureStrings

protected java.util.ArrayList<java.lang.String> _procedureStrings
The procedures created by the constraint


_baseTable

protected java.lang.String _baseTable
The base table of the constraint


_id

protected int _id
A unique identifier of the constraint


_b_i_tables

protected java.util.HashMap<java.lang.String,java.lang.String> _b_i_tables
HashMap of all procedures that are called BEFORE INSERT, indexed by the table that it applies to


_a_i_tables

protected java.util.HashMap<java.lang.String,java.lang.String> _a_i_tables
HashMap of all procedures that are called AFTER INSERT, indexed by the table that it applies to


_b_d_tables

protected java.util.HashMap<java.lang.String,java.lang.String> _b_d_tables
HashMap of all procedures that are calledBEFORE DELETE, indexed by the table that it applies to


_db_name

protected java.lang.String _db_name
The database name

Constructor Detail

ExportConstraint

public ExportConstraint()
Constructs a new contraint for exportation. Overloaded constructor that is never called explicitly.

Method Detail

addPath

public void addPath(ExportPath p)
Add a path to this constraint.

Parameters:
p - The path that participates in the constraint

getPaths

public java.util.ArrayList<ExportPath> getPaths()
Get all paths participating in this constraint

Returns:
The paths associated with this constraint

setBaseTable

public void setBaseTable()
Sets the base table for the constraint. Empty method that is overloaded by extending classes.


setTargetTable

public void setTargetTable()
Sets the target table(s) for the constraint. Empty method that is overloaded by extending classes.

Since:
2006-06-22 Vera Ranieri

getBaseTable

public java.lang.String getBaseTable()
The table that serves as a base for the constraint. Set differently depending on the type of constraint.

Returns:
The name of the base table

setConstraintStrings

public void setConstraintStrings()
Sets the constraint string for this constraint. Overloaded by all subclasses

Since:
2006-06-22 Vera Ranieri

getConstraintStrings

public java.util.ArrayList<java.lang.String> getConstraintStrings()
Gets the constraint string for this constraint. Overloaded by all subclasses.

Returns:
The constraint strings formatted for sql, in an array list.
Since:
2006-06-09 Vera Ranieri

getTimeNames

public java.util.HashMap<java.lang.String,java.lang.String> getTimeNames(java.lang.String time)
Gets the hash map containing all procedures to be called at time.

Parameters:
time - The time for which the constraints should be called.
Returns:
HashMap of all tables to be called at time, referenced by the table to which they apply
Since:
2006-06-28 Vera Ranieri

set_db_name

public void set_db_name(java.lang.String db_name)
Sets the database name

Parameters:
db_name - The database name to set.