easik.sketch.util.Export.Constraints
Class ExportProductConstraint

java.lang.Object
  extended by easik.sketch.util.Export.Constraints.ExportConstraint
      extended by easik.sketch.util.Export.Constraints.ExportProductConstraint

public class ExportProductConstraint
extends ExportConstraint

A class to create a product constraint object, including all necessary information gleaned from the XML file. 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-08-28 Kevin Green
Author:
Vera Ranieri 2006, Kevin Green 2006

Field Summary
private  java.lang.String DEL_PROC_NAME
          The name of the product delete constraint
private  java.lang.String INS_PROC_NAME
          The name of the product insert constraint
 
Fields inherited from class easik.sketch.util.Export.Constraints.ExportConstraint
_a_i_tables, _b_d_tables, _b_i_tables, _baseTable, _db_name, _id, _paths, _procedureStrings
 
Constructor Summary
ExportProductConstraint(int id)
          Constructor calling the constructor of the ExportConstraint superclass.
 
Method Summary
private  java.lang.String getFirstIfStatement(ExportPath p)
          Gets the first IF statement.
private  java.lang.String getInsertCall(ExportPath p)
          Gets the actual INSERT SELECT string for the constraint.
private  java.lang.String getPathInsertStrings(ExportPath p)
          Gets the strings inserting an element for every table along the path up until the base table.
private  java.lang.String getSecondIfStatement(ExportPath p)
          Gets the second IF statement.
 void setBaseTable()
          Sets the base table of this product constraint.
 void setConstraintStrings()
          Sets the constraint strings for this constraint
private  void setDeleteProc()
          Sets the delete constraint string for this constraint.
private  void setInsertProcs()
          Sets the insert constraint strings for this constraint.
 
Methods inherited from class easik.sketch.util.Export.Constraints.ExportConstraint
addPath, getBaseTable, getConstraintStrings, getPaths, getTimeNames, set_db_name, setTargetTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEL_PROC_NAME

private final java.lang.String DEL_PROC_NAME
The name of the product delete constraint

See Also:
Constant Field Values

INS_PROC_NAME

private final java.lang.String INS_PROC_NAME
The name of the product insert constraint

See Also:
Constant Field Values
Constructor Detail

ExportProductConstraint

public ExportProductConstraint(int id)
Constructor calling the constructor of the ExportConstraint superclass.

Parameters:
id - The unique identifier for this constraint
Method Detail

setBaseTable

public void setBaseTable()
Sets the base table of this product constraint. This table is the domain of all paths included in this constraint.

Overrides:
setBaseTable in class ExportConstraint

setConstraintStrings

public void setConstraintStrings()
Sets the constraint strings for this constraint

Overrides:
setConstraintStrings in class ExportConstraint
Since:
2006-06-22 Vera Ranieri

setDeleteProc

private void setDeleteProc()
Sets the delete constraint string for this constraint.

Since:
2006-06-22 Vera Ranieri

setInsertProcs

private void setInsertProcs()
Sets the insert constraint strings for this constraint.

Since:
2006-06-22 Vera Ranieri

getFirstIfStatement

private java.lang.String getFirstIfStatement(ExportPath p)
Gets the first IF statement. This statement determines whether the tables which form the domains of the other paths involved in the product constraint contain items. The statement is true if all tables have at least one element.

Parameters:
p -
Returns:
The string containing the first IF statement.

getPathInsertStrings

private java.lang.String getPathInsertStrings(ExportPath p)
Gets the strings inserting an element for every table along the path up until the base table. Also sets the variable var to the last insert id.

Parameters:
p - The path upon which we need to insert
Returns:
The string of all the insert calls
Since:
2006-06-28 Vera Ranieri

getSecondIfStatement

private java.lang.String getSecondIfStatement(ExportPath p)
Gets the second IF statement. This statement checks if any elements need to be added along a secondary path, before elements are added into the base table.

Parameters:
p -
Returns:
The string of the second IF statement. If this statement is unneeded, returns the empty string

getInsertCall

private java.lang.String getInsertCall(ExportPath p)
Gets the actual INSERT SELECT string for the constraint.

Parameters:
p - The path for which this constraint applies
Returns:
The string of the statement inserting into the table.
Since:
2006-06-28 Vera Ranieri