it.biobytes.ammentos
Class Trigger

java.lang.Object
  extended by it.biobytes.ammentos.Trigger

public abstract class Trigger
extends java.lang.Object

Represents a trigger which is able to execute operations when a table in the database is modified.

Author:
davide

Field Summary
static int ON_AFTER_UPDATE
           
static int ON_BEFORE_UPDATE
           
 
Constructor Summary
Trigger(int eventType)
          Creates a new instance of DatabaseTrigger
 
Method Summary
abstract  void execute(java.lang.Object oldObj, java.lang.Object newObj)
          Performs trigger operations.
 int getEventType()
          Returns the event type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_BEFORE_UPDATE

public static final int ON_BEFORE_UPDATE
See Also:
Constant Field Values

ON_AFTER_UPDATE

public static final int ON_AFTER_UPDATE
See Also:
Constant Field Values
Constructor Detail

Trigger

public Trigger(int eventType)
Creates a new instance of DatabaseTrigger

Method Detail

getEventType

public int getEventType()
Returns the event type


execute

public abstract void execute(java.lang.Object oldObj,
                             java.lang.Object newObj)
                      throws java.sql.SQLException
Performs trigger operations.

Parameters:
oldObj - The object instance before modification. It can be null (f.e. in INSERT statement)
newObj - The object instance after modification.
conn - The same connection where the update is happening
Throws:
java.sql.SQLException