All Implemented Interfaces:
Event, Serializable

public class EqualsHashCodeEvent extends EntityMappingEvent
The EqualsHashCodeEvent indicates that an entity does not define proper Object.equals(Object) and Object.hashCode() methods that provide the equivalence relation properties:
  • Reflexivity
  • Symmetry
  • Transitivity
  • Consistency
While the first three are quite easy to address, Consistency is trickier because, in the context of JPA, you need to make sure that multiple invocations of equals and hashCode yield the same result no matter the JPA entity state change (New, Managed, Detached, Removed).
Since:
2.5.0
Author:
Vlad Mihalcea
See Also:
  • Constructor Details

    • EqualsHashCodeEvent

      public EqualsHashCodeEvent(EntityMetadata entityMetadata, String entityStateTransitionMethodName)
      Instantiate the event using the provided parameters.
      Parameters:
      entityMetadata - entity metadata
      entityStateTransitionMethodName - the entity state transition method name
  • Method Details

    • getEntityStateTransitionMethodName

      public String getEntityStateTransitionMethodName()
      The entity state transition method name that was called when the entity was found to be already managed.
      Returns:
      entity state transition method name that was called
    • getPriority

      public Event.Priority getPriority()
      Get the Event.Priority of this Event
      Returns:
      the Event.Priority of this Event
    • getDescription

      public String getDescription()
      Get the String description of this Event
      Returns:
      the String description of this Event