Class EntityContext

java.lang.Object
com.broadleafcommerce.data.tracking.core.EntityContext

public class EntityContext extends Object
ThreadLocal context for passing a containing entity during Trackable.getNotificationStates() retrieval. Retrieving the notification states relies on the presence of a back reference to the containing entity for the Trackable embeddable instance. This reference is not always available - especially immediately after an entity is merged. We can backstop those missing cases by supplying an optional context instance of the back reference in order to more reliably fetch the relevant notification states. Refer to JpaNotificationStateUtility#get(..) as an example of consumption.
  • Constructor Details

    • EntityContext

      public EntityContext()
  • Method Details

    • getContext

      public static EntityContext getContext()
    • clear

      public static void clear()
    • getEntity

      public com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware getEntity()
    • setEntity

      public void setEntity(com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware entity)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object