Package org.h2gis.utilities.trigger
Class UpdateTrigger
- java.lang.Object
-
- org.h2gis.utilities.trigger.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
Fields Modifier and Type Field Description static StringNOTIFICATION_TABLEstatic StringTRIGGER_SCHEMAstatic StringTRIGGER_TABLE
-
Constructor Summary
Constructors Constructor Description UpdateTrigger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfire(Connection conn, Object[] oldRow, Object[] newRow)voidinit(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type)voidremove()
-
-
-
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
-
-
Method Detail
-
close
public void close() throws SQLException- Specified by:
closein interfaceorg.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:
initin interfaceorg.h2.api.Trigger- Throws:
SQLException
-
fire
public void fire(Connection conn, Object[] oldRow, Object[] newRow) throws SQLException
- Specified by:
firein interfaceorg.h2.api.Trigger- Throws:
SQLException
-
remove
public void remove() throws SQLException- Specified by:
removein interfaceorg.h2.api.Trigger- Throws:
SQLException
-
-