📄 trigger.java
字号:
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
* Title: XELOPES Data Mining Library
* Description: The XELOPES library is an open platform-independent and data-source-independent library for Embedded Data Mining.
* Copyright: Copyright (c) 2002 Prudential Systems Software GmbH
* Company: ZSoft (www.zsoft.ru), Prudsys (www.prudsys.com)
* @author Valentine Stepanenko (valentine.stepanenko@zsoft.ru)
* @version 1.0
*/
package com.prudsys.pdm.Cwm.Relational;
import java.util.Collection;
import java.util.Iterator;
import com.prudsys.pdm.Cwm.Core.BooleanExpression;
import com.prudsys.pdm.Cwm.Core.ModelElement;
import com.prudsys.pdm.Cwm.Core.ProcedureExpression;
import com.prudsys.pdm.Cwm.Relational.Enumerations.ActionOrientationType;
import com.prudsys.pdm.Cwm.Relational.Enumerations.ConditionTimingType;
import com.prudsys.pdm.Cwm.Relational.Enumerations.EventManipulationType;
/**
* An action run by the DBMS when specified events occur on the table owning the
* Trigger
*/
public class Trigger extends ModelElement implements org.omg.cwm.resource.relational.Trigger
{
/**
* Indicates what types of events are using the current Trigger.
*/
public EventManipulationType eventManipulation;
/**
* A boolean expression which defines when the trigger has to be executed
*/
public BooleanExpression actionCondition;
/**
* The Trigger action itself
*/
public ProcedureExpression actionStatement;
/**
* It indicates if the trigger is called once per statement execution or before or
* after each row of the table is modified.
*/
public ActionOrientationType actionOrientation;
/**
* It indicates if the trigger activity is run before or after the statement or
* row is modified.
*/
public ConditionTimingType conditionTiming;
/**
* The alias for the owning table name, used in the actionStatement, to represent
* the state of the table after the insert/delete/update
*/
public com.prudsys.pdm.Cwm.Core.String conditionReferenceNewTable;
/**
* The alias for the name of the owning table, used in the actionStatement, to
* represent the state of the table before the update/delete/insert.
*/
public com.prudsys.pdm.Cwm.Core.String conditionReferenceOldTable;
public Table table1;
public NamedColumnSet usedColumnSet[];
public Table table;
public Trigger()
{
}
public org.omg.cwm.objectmodel.core.BooleanExpression getActionCondition() {
return actionCondition;
}
public void setActionCondition(org.omg.cwm.objectmodel.core.BooleanExpression actionCondition) {
this.actionCondition = (BooleanExpression) actionCondition;
}
public java.lang.String getActionOrientation() {
return actionOrientation.getString();
}
public void setActionOrientation(java.lang.String actionOrientation) {
ActionOrientationType a = new ActionOrientationType();
a.setString(actionOrientation);
this.actionOrientation = a;
}
public org.omg.cwm.objectmodel.core.ProcedureExpression getActionStatement() {
return actionStatement;
}
public void setActionStatement(org.omg.cwm.objectmodel.core.ProcedureExpression actionStatement) {
this.actionStatement = (ProcedureExpression) actionStatement;
}
public java.lang.String getConditionReferenceNewTable() {
return conditionReferenceNewTable.getString();
}
public void setConditionReferenceNewTable(java.lang.String conditionReferenceNewTable) {
com.prudsys.pdm.Cwm.Core.String s = new com.prudsys.pdm.Cwm.Core.String();
s.setString(conditionReferenceNewTable);
this.conditionReferenceNewTable = s;
}
public java.lang.String getConditionReferenceOldTable() {
return conditionReferenceOldTable.getString();
}
public void setConditionReferenceOldTable(java.lang.String conditionReferenceOldTable) {
com.prudsys.pdm.Cwm.Core.String s = new com.prudsys.pdm.Cwm.Core.String();
s.setString(conditionReferenceOldTable);
this.conditionReferenceOldTable = s;
}
public java.lang.String getConditionTiming() {
return conditionTiming.getString();
}
public void setConditionTiming(java.lang.String conditionTiming) {
ConditionTimingType c = new ConditionTimingType();
c.setString(conditionTiming);
this.conditionTiming = c;
}
public java.lang.String getEventManipulation() {
return eventManipulation.getString();
}
public void setEventManipulation(java.lang.String eventManipulation) {
EventManipulationType e = new EventManipulationType();
e.setString(eventManipulation);
this.eventManipulation = e;
}
public Collection getUsedColumnSet() {
return com.prudsys.pdm.Cwm.Core.CWMTools.ArrayToList(usedColumnSet);
}
public void setUsedColumnSet(Collection usedColumnSet) {
this.usedColumnSet = new NamedColumnSet[ usedColumnSet.size() ];
Iterator it = usedColumnSet.iterator();
for (int i = 0; i < usedColumnSet.size(); i++)
this.usedColumnSet[i] = (NamedColumnSet) it.next();
}
public void addUsedColumnSet( org.omg.cwm.resource.relational.NamedColumnSet input) {
int size = (usedColumnSet == null) ? 0 : usedColumnSet.length;
NamedColumnSet[] oldData = usedColumnSet;
usedColumnSet = new NamedColumnSet[size+1];
if (size > 0) System.arraycopy(oldData, 0, usedColumnSet, 0, size);
usedColumnSet[size] = (NamedColumnSet) input;
}
public void removeUsedColumnSet( org.omg.cwm.resource.relational.NamedColumnSet input) {
int size = (usedColumnSet == null) ? 0 : usedColumnSet.length;
if (size == 0)
return;
int ipos = -1;
for (int i = 0; i < size; i++)
if (usedColumnSet[i].equals(input)) {
ipos = i;
break;
}
if (ipos == -1)
return;
NamedColumnSet[] oldData = usedColumnSet;
usedColumnSet = new NamedColumnSet[size-1];
for (int i = 0; i < ipos; i++)
usedColumnSet[i] = oldData[i];
for (int i = ipos+1; i < size; i++)
usedColumnSet[i-1] = oldData[i];
}
public org.omg.cwm.resource.relational.Table getTable() {
return table;
}
public void setTable(org.omg.cwm.resource.relational.Table table) {
this.table = (Table) table;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -