|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.sql.TriggerGenerator
A trigger generator that can generate trigger definitions, which can be used to evaluate integrity views. Two kinds of trigger definitions are possible. Trigger definitions which serve as SQL92-assertion-replacements and ECA-trigger-templates. The trigger templates must be further edited by the application developer. The trigger generator takes care for multiple tables which can be involved in one integrity view evaluation. Hence, the information about the involved tables must be provided to the generator. The generator then generates one trigger per involved table.
SQLBuilder
Field Summary | |
static int |
ASSERTION_REPLACEMENT
|
static int |
ECA_TRIGGER_TEMPLATE
|
(package private) int |
kindOfTrigger
|
(package private) String |
theErrorMessage
|
(package private) String[] |
theInvolvedTables
|
(package private) String[] |
theResult
|
(package private) SQLBuilder |
theSQLBuilder
|
(package private) String |
theTriggerName
|
(package private) String |
theViewName
|
Constructor Summary | |
TriggerGenerator(SQLBuilder sqlBuilder)
Creates a new TriggerGenerator |
Method Summary | |
void |
construct()
Does the construction of the SQL code. |
private String[] |
getAssertionReplacement()
|
String[] |
getAssertionReplacement(String triggerName,
String errorMsg,
String viewName,
String[] involvedTables)
|
String |
getCode()
|
private String[] |
getECATriggerTemplate()
|
String[] |
getECATriggerTemplate(String triggerName,
String viewName,
String[] involvedTables)
|
void |
setBuilder(SQLBuilder sqlb)
|
void |
setErrorMsg(String msg)
An error message that will be thrown from assertion replacement triggers. |
void |
setInvolvedTables(String[] tables)
An array of table names that are involved in evaluating the related integrity view. |
void |
setKindOfTrigger(int kot)
|
void |
setTriggerName(String name)
The prefix of all trigger names. |
void |
setViewName(String name)
The name of the integrity view. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
String theTriggerName
String theViewName
String theErrorMessage
String[] theInvolvedTables
String[] theResult
SQLBuilder theSQLBuilder
int kindOfTrigger
public static int ASSERTION_REPLACEMENT
public static int ECA_TRIGGER_TEMPLATE
Constructor Detail |
public TriggerGenerator(SQLBuilder sqlBuilder)
Method Detail |
private String[] getAssertionReplacement()
private String[] getECATriggerTemplate()
public String[] getAssertionReplacement(String triggerName, String errorMsg, String viewName, String[] involvedTables)
triggerName
- the prefix of each trigger name, the actual trigger name will get further information appendederrorMsg
- the error message that will be thrown by the triggersviewName
- the name of the integrity viewinvolvedTables
- a list of involved tables
public String[] getECATriggerTemplate(String triggerName, String viewName, String[] involvedTables)
triggerName
- the prefix of each trigger name, the actual trigger name will get further information appendedviewName
- the name of the integrity viewinvolvedTables
- a list of involved tables
public void setTriggerName(String name)
public void setViewName(String name)
public void setErrorMsg(String msg)
public void setInvolvedTables(String[] tables)
public void setKindOfTrigger(int kot)
public void setBuilder(SQLBuilder sqlb)
setBuilder
in interface SQLDirector
sqlb
- a builder used by the director to build database specific codepublic void construct() throws IllegalStateException
construct
in interface SQLDirector
IllegalStateException
public String getCode()
getCode
in interface SQLDirector
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |