|
jACOB 2.7 API Documentation. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectDataEventHandler
de.tif.jacob.core.data.event.DataTableRecordEventHandler
public abstract class DataTableRecordEventHandler
This class represents the abstract base class for all data table record event
handlers. A data table record event handler has to be implemented to "hook"
application-specific business logic to table aliases. Therefore, the
following hook methods could be implemented:
afterNewAction(IDataTableRecord, IDataTransaction)
afterDeleteAction(IDataTableRecord, IDataTransaction)
beforeCommitAction(IDataTableRecord, IDataTransaction)
afterCommitAction(IDataTableRecord)
The jACOB application server then executes those hook methods on data level whenever data records of the related table alias are modified.
| Field Summary | |
|---|---|
static java.lang.String |
RCS_ID
The internal revision control system id. |
static java.lang.String |
RCS_REV
The internal revision control system id in short form. |
| Constructor Summary | |
|---|---|
DataTableRecordEventHandler()
|
|
| Method Summary | |
|---|---|
abstract void |
afterCommitAction(IDataTableRecord tableRecord)
This hook method will be called immediately after a record modification has been pushed to the data source. |
abstract void |
afterDeleteAction(IDataTableRecord tableRecord,
IDataTransaction transaction)
This hook method will be called immediately after a delete operation has been invoked on the given record instance. |
abstract void |
afterNewAction(IDataTableRecord tableRecord,
IDataTransaction transaction)
This hook method will be called immediately after a new record instance has been created and initialized. |
abstract void |
beforeCommitAction(IDataTableRecord tableRecord,
IDataTransaction transaction)
This hook method will be called immediately before a record modification will be pushed to the data source. |
static DataTableRecordEventHandler |
get(IDataTable table)
Internal method for fetching an event handler by means of the given data table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final transient java.lang.String RCS_ID
public static final transient java.lang.String RCS_REV
| Constructor Detail |
|---|
public DataTableRecordEventHandler()
| Method Detail |
|---|
public abstract void afterNewAction(IDataTableRecord tableRecord, IDataTransaction transaction) throws java.lang.Exception
Attention: The record has not been committed to the data source!
tableRecord - the table recordtransaction - the transaction in which context this method is called
java.lang.Exception - on any error, exception will be handed over to the callerIDataTable.newRecord(IDataTransaction),
IDataAccessor.cloneRecord(IDataTransaction, IDataTableRecord),
IDataAccessor.cloneRecord(IDataTransaction, IDataTableRecord,
ITableAlias),
IDataAccessor.cloneRecord(IDataTransaction, IDataTableRecord, String)public abstract void afterDeleteAction(IDataTableRecord tableRecord, IDataTransaction transaction) throws java.lang.Exception
Attention: The record deletion has not been pushed to the data source!
tableRecord - the table recordtransaction - the transaction in which context this method is called
java.lang.Exception - on any error, exception will be handed over to the callerIDataTableRecord.delete(IDataTransaction),
IDataTable.searchAndDelete(IDataTransaction),
IDataTable.fastDelete(IDataTransaction)public abstract void beforeCommitAction(IDataTableRecord tableRecord, IDataTransaction transaction) throws java.lang.Exception
This hook method is the right place to carry out further application
specific actions within the same transactional context and is especially
useful to implement extended data consistency checks which are not handled
by the underlying database. This is done by means of throwing an exception
(in most cases this will be a
UserException), if such a consistency
check fails.
Attention: This hook method does not have a recursive
behaviour, i.e. neither
beforeCommitAction(IDataTableRecord, IDataTransaction) nor
afterCommitAction(IDataTableRecord) hook methods will be called
for data records being additionally created or manipulated within this method.
Nevertheless, this is the case for
afterNewAction(IDataTableRecord, IDataTransaction) and
afterDeleteAction(IDataTableRecord, IDataTransaction)!
tableRecord - the table recordtransaction - the transaction in which context this method is called
java.lang.Exception - on any error, exception will be handed over to the callerIDataTransaction.commit()public abstract void afterCommitAction(IDataTableRecord tableRecord) throws java.lang.Exception
This hook method could be used to carry out further application actions within a separate transactional context.
tableRecord - the table record
java.lang.Exception - on any error, exception will NOT be handed over to the
caller but a log entry will be written.IDataTransaction.commit()public static final DataTableRecordEventHandler get(IDataTable table) throws java.lang.Exception
table - the data table to fetch the event handler for
java.lang.Exception - a severe problem has occurred
|
jACOB 2.7 API Documentation. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||