Package com.mckoi.database
Class TableModificationEvent
java.lang.Object
com.mckoi.database.TableModificationEvent
The event information of when a table is modified inside a transaction.
- Author:
- Tobias Downer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Event that occurs after the actionstatic final int
Event for after a delete.static final int
Event for after an insert.static final int
Event for after an update.static final int
Event that occurs before the actionstatic final int
Event for before a delete.static final int
Event for before an insert.static final int
Event for before an update.static final int
Event type for delete action.static final int
Event type for insert action.static final int
Event type for update action. -
Method Summary
Modifier and TypeMethodDescriptionReturns the DatabaseConnection that this event fired in.Returns the RowData object that represents the change that is being made to the table either by an INSERT or UPDATE.int
Returns the index of the row in the table that was affected by this event or -1 if event type is INSERT.Returns the name of the table of this modification.int
getType()
Returns the event type.boolean
isAfter()
Returns true if this is a AFTER event.boolean
isBefore()
Returns true if this is a BEFORE event.boolean
isDelete()
Returns true if this is an DELETE event.boolean
isInsert()
Returns true if this is an INSERT event.boolean
isUpdate()
Returns true if this is an UPDATE event.boolean
listenedBy
(int listen_t) Returns true if the given listener type should be notified of this type of table modification event.
-
Field Details
-
BEFORE
public static final int BEFOREEvent that occurs before the action- See Also:
-
AFTER
public static final int AFTEREvent that occurs after the action- See Also:
-
INSERT
public static final int INSERTEvent type for insert action.- See Also:
-
UPDATE
public static final int UPDATEEvent type for update action.- See Also:
-
DELETE
public static final int DELETEEvent type for delete action.- See Also:
-
BEFORE_INSERT
public static final int BEFORE_INSERTEvent for before an insert.- See Also:
-
AFTER_INSERT
public static final int AFTER_INSERTEvent for after an insert.- See Also:
-
BEFORE_UPDATE
public static final int BEFORE_UPDATEEvent for before an update.- See Also:
-
AFTER_UPDATE
public static final int AFTER_UPDATEEvent for after an update.- See Also:
-
BEFORE_DELETE
public static final int BEFORE_DELETEEvent for before a delete.- See Also:
-
AFTER_DELETE
public static final int AFTER_DELETEEvent for after a delete.- See Also:
-
-
Method Details
-
getDatabaseConnection
Returns the DatabaseConnection that this event fired in. -
getType
public int getType()Returns the event type. -
isBefore
public boolean isBefore()Returns true if this is a BEFORE event. -
isAfter
public boolean isAfter()Returns true if this is a AFTER event. -
isInsert
public boolean isInsert()Returns true if this is an INSERT event. -
isUpdate
public boolean isUpdate()Returns true if this is an UPDATE event. -
isDelete
public boolean isDelete()Returns true if this is an DELETE event. -
getTableName
Returns the name of the table of this modification. -
getRowIndex
public int getRowIndex()Returns the index of the row in the table that was affected by this event or -1 if event type is INSERT. -
getRowData
Returns the RowData object that represents the change that is being made to the table either by an INSERT or UPDATE. For a DELETE event this return null. -
listenedBy
public boolean listenedBy(int listen_t) Returns true if the given listener type should be notified of this type of table modification event. For example, if this is a BEFORE event then the BEFORE bit on the given type must be set and if this is an INSERT event then the INSERT bit on the given type must be set.
-