butler.ext.log
Class TimestampListener

java.lang.Object
  extended by butler.sql.record.RecordListener.BaseImpl
      extended by butler.ext.log.TimestampListener
All Implemented Interfaces:
RecordListener

public class TimestampListener
extends RecordListener.BaseImpl

Record listener that ensure that a timestamp column is updated with current timestamp.

Author:
Fredrik Bertilsson

Nested Class Summary
 
Nested classes/interfaces inherited from interface butler.sql.record.RecordListener
RecordListener.BaseImpl
 
Constructor Summary
TimestampListener(Column col)
           
 
Method Summary
 void beforeInsert(Record rec)
           
 void beforeUpdate(Record rec)
           
 void setTimestampCallback(TimestampCallback callback)
           
 
Methods inherited from class butler.sql.record.RecordListener.BaseImpl
afterDelete, afterInsert, afterSet, afterUpdate, beforeDelete, beforeSet, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampListener

public TimestampListener(Column col)
Method Detail

setTimestampCallback

public void setTimestampCallback(TimestampCallback callback)

beforeUpdate

public void beforeUpdate(Record rec)
                  throws java.lang.Exception
Specified by:
beforeUpdate in interface RecordListener
Overrides:
beforeUpdate in class RecordListener.BaseImpl
Throws:
java.lang.Exception

beforeInsert

public void beforeInsert(Record rec)
                  throws java.lang.Exception
Specified by:
beforeInsert in interface RecordListener
Overrides:
beforeInsert in class RecordListener.BaseImpl
Throws:
java.lang.Exception