| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0_20) on Sun Jun 06 23:05:42 EDT 2010 --> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <TITLE> |
| Trigger (HSQLDB 2.0.0 API) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2010-06-06"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../javadoc.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Trigger (HSQLDB 2.0.0 API)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Trigger.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../index.html?org/hsqldb/Trigger.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Trigger.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.hsqldb</FONT> |
| <BR> |
| Interface Trigger</H2> |
| <DL> |
| <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../org/hsqldb/sample/TriggerSample.html" title="class in org.hsqldb.sample">TriggerSample</A></DD> |
| </DL> |
| <HR> |
| <DL> |
| <DT><PRE>public interface <B>Trigger</B></DL> |
| </PRE> |
| |
| <P> |
| The interface an HSQLDB TRIGGER must implement. The user-supplied class that |
| implements this must have a default constructor. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Since:</B></DT> |
| <DD>1.7.0</DD> |
| <DT><B>Author:</B></DT> |
| <DD>Peter Hudson</DD> |
| </DL> |
| <HR> |
| |
| <P> |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Field Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#DELETE_AFTER">DELETE_AFTER</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#DELETE_AFTER_ROW">DELETE_AFTER_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#DELETE_BEFORE_ROW">DELETE_BEFORE_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#INSERT_AFTER">INSERT_AFTER</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#INSERT_AFTER_ROW">INSERT_AFTER_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#INSERT_BEFORE_ROW">INSERT_BEFORE_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#UPDATE_AFTER">UPDATE_AFTER</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#UPDATE_AFTER_ROW">UPDATE_AFTER_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static int</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#UPDATE_BEFORE_ROW">UPDATE_BEFORE_ROW</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../org/hsqldb/Trigger.html#fire(int, java.lang.String, java.lang.String, java.lang.Object[], java.lang.Object[])">fire</A></B>(int type, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> trigName, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> tabName, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] oldRow, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] newRow)</CODE> |
| |
| <BR> |
| The method invoked upon each triggered action.</TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ FIELD DETAIL =========== --> |
| |
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Field Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="INSERT_AFTER"><!-- --></A><H3> |
| INSERT_AFTER</H3> |
| <PRE> |
| static final int <B>INSERT_AFTER</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.INSERT_AFTER">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="DELETE_AFTER"><!-- --></A><H3> |
| DELETE_AFTER</H3> |
| <PRE> |
| static final int <B>DELETE_AFTER</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.DELETE_AFTER">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="UPDATE_AFTER"><!-- --></A><H3> |
| UPDATE_AFTER</H3> |
| <PRE> |
| static final int <B>UPDATE_AFTER</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.UPDATE_AFTER">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="INSERT_AFTER_ROW"><!-- --></A><H3> |
| INSERT_AFTER_ROW</H3> |
| <PRE> |
| static final int <B>INSERT_AFTER_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.INSERT_AFTER_ROW">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="DELETE_AFTER_ROW"><!-- --></A><H3> |
| DELETE_AFTER_ROW</H3> |
| <PRE> |
| static final int <B>DELETE_AFTER_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.DELETE_AFTER_ROW">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="UPDATE_AFTER_ROW"><!-- --></A><H3> |
| UPDATE_AFTER_ROW</H3> |
| <PRE> |
| static final int <B>UPDATE_AFTER_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.UPDATE_AFTER_ROW">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="INSERT_BEFORE_ROW"><!-- --></A><H3> |
| INSERT_BEFORE_ROW</H3> |
| <PRE> |
| static final int <B>INSERT_BEFORE_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.INSERT_BEFORE_ROW">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="DELETE_BEFORE_ROW"><!-- --></A><H3> |
| DELETE_BEFORE_ROW</H3> |
| <PRE> |
| static final int <B>DELETE_BEFORE_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.DELETE_BEFORE_ROW">Constant Field Values</A></DL> |
| </DL> |
| <HR> |
| |
| <A NAME="UPDATE_BEFORE_ROW"><!-- --></A><H3> |
| UPDATE_BEFORE_ROW</H3> |
| <PRE> |
| static final int <B>UPDATE_BEFORE_ROW</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#org.hsqldb.Trigger.UPDATE_BEFORE_ROW">Constant Field Values</A></DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="fire(int, java.lang.String, java.lang.String, java.lang.Object[], java.lang.Object[])"><!-- --></A><H3> |
| fire</H3> |
| <PRE> |
| void <B>fire</B>(int type, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> trigName, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> tabName, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] oldRow, |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] newRow) |
| throws org.hsqldb.HsqlException</PRE> |
| <DL> |
| <DD>The method invoked upon each triggered action. |
| |
| <p> type contains the integer index id for trigger type, e.g. |
| TriggerDef.INSERT_AFTER |
| |
| <p> For all triggers defined as default FOR EACH STATEMENT both |
| oldRow and newRow are null. |
| |
| <p> For triggers defined as FOR EACH ROW, the following will apply: |
| |
| <p> When UPDATE triggers are fired, oldRow contains the existing values |
| of the table row and newRow contains the new values. |
| |
| <p> For INSERT triggers, oldRow is null and newRow contains the table row |
| to be inserted. For DELETE triggers, newRow is null and oldRow contains |
| the table row to be deleted. |
| |
| <p> For error conditions, users can construct an HsqlException using one |
| of the static methods of org.hsqldb.error.Error with a predefined |
| SQL State from org.hsqldb.error.ErrorCode. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>type</CODE> - int<DD><CODE>trigName</CODE> - the name of the trigger<DD><CODE>tabName</CODE> - the name of the table upon which the triggered action is |
| occuring<DD><CODE>oldRow</CODE> - the old row<DD><CODE>newRow</CODE> - the new row |
| <DT><B>Throws:</B> |
| <DD><CODE>org.hsqldb.HsqlException</CODE></DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Trigger.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../index.html?org/hsqldb/Trigger.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Trigger.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| <i>Copyright © 2001 - 2009 HSQL Development Group.</i> |
| </BODY> |
| </HTML> |