title: how do I correctly override equals for inheritance in java?
body: <p>I am using hibernate and id... is used for persistence (which is why it is omitted in comparison). (Also, using google guava helper equals)</p>
  
  <p>HolidayPackageVariant:</p>
  
  <pre><code>public abstract class HolidayPackageVariant {
      private Integer idHolidayPackageVariant;
      private HolidayPackage holidayPackage;
      private String typeHolidayPackage;
  
  @Override
  public boolean equals(Object obj) {
      if (obj == this)
          return true;
      if(obj == null)
          return false;
  
      if (getClass().equals(obj.getClass())) {
          final HolidayPackageVariant otherPackageVariant = (HolidayPackageVariant) obj;
          return Objects.equal(getTypeHolidayPackage(),otherPackageVariant.getTypeHolidayPackage())
                  &amp;&amp; Objects.equal(getHolidayPackage(),
                          otherPackageVariant.getHolidayPackage());
      }
      return false;
  }
  
  @Override
  public int hashCode() {
      return Objects.hashCode(getTypeHolidayPackage(), getHolidayPackage());
  }
  </code></pre>
  
  <p>FlightHolidayPackageVariant:</p>
  
  <pre><code>public final class FlightHolidayPackageVariant extends HolidayPackageVariant{
      private Destination originCity;
      public boolean equals(Object obj) {
      // .. 
  </code></pre>
  
  <p>Should I completely override the equals() or should I be invoking super.equals(...) in some way ?</p>