com.pow2.dbforms
Class Interceptor

java.lang.Object
  extended byorg.dbforms.event.DbEventInterceptorSupport
      extended bycom.pow2.dbforms.Interceptor
All Implemented Interfaces:
DbEventInterceptor

public class Interceptor
extends DbEventInterceptorSupport

DbForm interceptor (hook up class).
Note: do not close connection objects used in DbEventInterceptor methods.

Author:
Luca Fossato

Field Summary
protected static org.apache.log4j.Category cat
          Log4j category
 
Fields inherited from interface org.dbforms.config.DbEventInterceptor
DENY_OPERATION, GRANT_OPERATION, IGNORE_OPERATION, POST_DELETE, POST_INSERT, POST_SELECT, POST_UPDATE, PRE_DELETE, PRE_INSERT, PRE_SELECT, PRE_UPDATE
 
Constructor Summary
Interceptor()
           
 
Method Summary
protected  int delete(Connection con, FieldValues fieldValues, String tableName, String keyFieldName, boolean isKeyAString)
          Delete a record with a non composite key from the input table.
protected  int delete(String tableName, String cond, Connection con)
          Delete all the records of the input table that match the input condition.
protected  long getNewKey()
          Return a new unique key.
 
Methods inherited from class org.dbforms.event.DbEventInterceptorSupport
getParams, postDelete, postInsert, postSelect, postUpdate, preDelete, preInsert, preSelect, preUpdate, setParams, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat
Log4j category

Constructor Detail

Interceptor

public Interceptor()
Method Detail

delete

protected int delete(Connection con,
                     FieldValues fieldValues,
                     String tableName,
                     String keyFieldName,
                     boolean isKeyAString)
              throws ValidationException
Delete a record with a non composite key from the input table.

Parameters:
con - the JDBC connection object
fieldValues - the fieldValues object taken from the interceptor interface
tableName - the table name of the record to delete
keyFieldName - the name of the NON composite key field
isKeyAString - yes if the key value type is string; false otherwise
Returns:
the opertaion code value specified by the dbForms' interceptor interface
Throws:
ValidationException - if any error occurs

delete

protected int delete(String tableName,
                     String cond,
                     Connection con)
              throws ValidationException
Delete all the records of the input table that match the input condition.

Parameters:
tableName - the name of the database table
cond - the SQL condition string (a WHERE clause without the 'where' world)
con - the connection object
Returns:
GRANT_OPERATION if the delete function is successfull
Throws:
ValidationException - if any error occurs

getNewKey

protected long getNewKey()
                  throws ValidationException
Return a new unique key.

Returns:
a new unique key
Throws:
ValidationException - if any error occurs


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.