Class PreUpdateEvent

  • All Implemented Interfaces:
    IPortalEvent

    @StableMinor(version="16.0",
                 sinceVersion="4.2")
    public class PreUpdateEvent
    extends PersistenceEvent
    Event raised before the update of an entity in persistence.

    Note: A persistence event may have been generated during a JPA entity lifecycle callback. In such situations, JPA limitations (such as the application should not access EntityManager, other entities, or change relations) apply.

    Since:
    4.1.0
    Version:
    $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
    • Constructor Detail

      • PreUpdateEvent

        public PreUpdateEvent​(SessionConfig sessionConfig,
                              java.lang.Class<?> entityClass,
                              java.lang.Object oldEntity,
                              java.lang.Object entity,
                              ITransaction transaction)
      • PreUpdateEvent

        public PreUpdateEvent​(SessionConfig sessionConfig,
                              java.lang.Class<?> entityClass,
                              java.util.List<?> oldEntities,
                              java.util.List<?> newEntities,
                              ITransaction transaction)
    • Method Detail

      • getEntities

        public java.util.List<?> getEntities()
        Description copied from class: PersistenceEvent
        Returns the entities affected by this persistence event.
        Overrides:
        getEntities in class PersistenceEvent
        Returns:
        the entities.
      • getOldEntities

        public java.util.List<?> getOldEntities()
        Returns the entity state before the update. Each entity in the list returned corresponds to the entity in the same index of the list returned by getEntities().

        Note that this information may not be available in the event, depending on who generated the event. In this case, this method will return null.

        Returns:
        the entity state before the update.
        Since:
        4.1.0