Class AfterSaveEvent

java.lang.Object
de.hybris.platform.tx.AfterSaveEvent

public class AfterSaveEvent extends 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 Details

  • Constructor Details

    • 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 Details

    • getPk

      public PK getPk()
    • getType

      public int getType()
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object