Class AbstractEntity<ID extends org.jmolecules.ddd.types.Identifier>

java.lang.Object
org.salespointframework.core.AbstractEntity<ID>
All Implemented Interfaces:
Persistable<ID>
Direct Known Subclasses:
AbstractAggregateRoot, ChargeLine, OrderLine

@MappedSuperclass public abstract class AbstractEntity<ID extends org.jmolecules.ddd.types.Identifier> extends Object implements Persistable<ID>
Base class for Salespoint entities to uniquely define equals(Object) and hashCode().
Author:
Oliver Gierke
  • Constructor Details

    • AbstractEntity

      public AbstractEntity()
  • Method Details

    • hasId

      public boolean hasId(ID id)
      Returns whether the entity has the given identifier.
      Parameters:
      id - must not be null.
      Returns:
    • isNew

      public boolean isNew()
      Specified by:
      isNew in interface Persistable<ID extends org.jmolecules.ddd.types.Identifier>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object