15.2. Interface DbEventInterceptor

DbForms provides the DbEventInterceptor interface, which is capable of intercepting database operations (before and after they are executed).

This interface provides the following methods

Example 15.1. Methods defined in interface DbEventInterceptor

    public int preInsert(HttpServletRequest request, Table table, FieldValues fieldValues,
                DbFormsConfig config, Connection con)
                throws ValidationException;
 

    public void postInsert(HttpServletRequest request, DbFormsConfig config, Connection con);
 

    public int preUpdate(HttpServletRequest request, Table table, FieldValues fieldValues,
                DbFormsConfig config, Connection con)
                throws ValidationException;
 

    public void postUpdate(HttpServletRequest request, DbFormsConfig config, Connection con);
 

    public int preDelete(HttpServletRequest request, Table table, FieldValues fieldValues,
                DbFormsConfig config, Connection  con)
                throws ValidationException;


    public void 
        postDelete(HttpServletRequest request, DbFormsConfig config, Connection con);

     
    public int 
        preSelect(HttpServletRequest request, DbFormsConfig config, Connection con)
                throws ValidationException;
 
    public void 
        postSelect(HttpServletRequest request, DbFormsConfig config, Connection con);
 
    
        (Note: the following pre/postAddRow methods are used to make a custom filter by selectively ignoring the results of our query,
        sum values, or just merge some columns which can not be merged in sql.  See IGNORE_OPERATION
        below.  Also, they are useful for counting rows -- see howtoAddRowCountSupport.jsp under /bookstore/howto/)
    
    public int preAddRow(DbEventInterceptorData data)
                 throws ValidationException, MultipleValidationException;
   
                 
    public void postAddRow(DbEventInterceptorData data);
    
      

As the names indicate: