Class AfterSaveEvent


  • public class AfterSaveEvent
    extends java.lang.Object
    An AfterSaveEvent is created after a database operation on an item. The PK of the item is recorded, and the type as well. There are three types supported: UPDATE, REMOVE, and CREATE.
      Rules to create an AfterSaveEvent when transaction is used and multiple operations have been executed on the SAME item(Note: all of the operations are executed between one BEGIN and COMMIT database action):
    • for CREATE: create + update(*)
    • for UPDATE: update(+)
    • for REMOVE: update(*) + remove
      NO AfterSaveEvent will be created when the transaction rolls back as well as under the following situation:
    • create + update(*) + remove

    If there is no active transaction, each database operation on the item needs to be recorded so that an AfterSaveEvent will be created.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CREATE  
      static int REMOVE  
      static int UPDATE  
    • Constructor Summary

      Constructors 
      Constructor Description
      AfterSaveEvent​(PK pk, int type)
      Creates the AfterSaveEvent.
    • Constructor Detail

      • AfterSaveEvent

        public AfterSaveEvent​(PK pk,
                              int type)
        Creates the AfterSaveEvent.
        Parameters:
        pk - the pk of the item
        type - the operation type on the item, either UPDATE, REMOVE, or CREATE is allowed
    • Method Detail

      • getPk

        public PK getPk()
      • getType

        public int getType()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object