org.h2gis.h2spatial.internal
Class UpdateTrigger

java.lang.Object
  extended by org.h2gis.h2spatial.internal.UpdateTrigger
All Implemented Interfaces:
org.h2.api.Trigger

public class UpdateTrigger
extends Object
implements org.h2.api.Trigger

This trigger is used to track modifications on tables by inserting notifications into a temporary table. The table H2GIS_SCHEMA.UPDATE_TRIGGERS contain the list of created triggers. The table H2GIS_SCHEMA.UPDATE_NOTIFICATIONS contain the list of updates related to triggers. When this trigger is attached to a table, a line is inserted in H2GIS_SCHEMA.UPDATE_NOTIFICATIONS each time this table is updated.

Author:
Nicolas Fortin

Field Summary
static String NOTIFICATION_TABLE
           
static String TRIGGER_SCHEMA
           
static String TRIGGER_TABLE
           
 
Fields inherited from interface org.h2.api.Trigger
DELETE, INSERT, SELECT, UPDATE
 
Constructor Summary
UpdateTrigger()
           
 
Method Summary
 void close()
           
 void fire(Connection conn, Object[] oldRow, Object[] newRow)
           
 void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type)
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIGGER_SCHEMA

public static final String TRIGGER_SCHEMA
See Also:
Constant Field Values

TRIGGER_TABLE

public static final String TRIGGER_TABLE
See Also:
Constant Field Values

NOTIFICATION_TABLE

public static final String NOTIFICATION_TABLE
See Also:
Constant Field Values
Constructor Detail

UpdateTrigger

public UpdateTrigger()
Method Detail

close

public void close()
           throws SQLException
Specified by:
close in interface org.h2.api.Trigger
Throws:
SQLException

init

public void init(Connection conn,
                 String schemaName,
                 String triggerName,
                 String tableName,
                 boolean before,
                 int type)
          throws SQLException
Specified by:
init in interface org.h2.api.Trigger
Throws:
SQLException

fire

public void fire(Connection conn,
                 Object[] oldRow,
                 Object[] newRow)
          throws SQLException
Specified by:
fire in interface org.h2.api.Trigger
Throws:
SQLException

remove

public void remove()
            throws SQLException
Specified by:
remove in interface org.h2.api.Trigger
Throws:
SQLException


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.