title: Entity's equals() don't work properly in HashSet
body: <p>Could you give me an idea mhy equals() doesn't work properly in POJO, when its entity is added to HashSet? I checked and hascode() works correctly because returns the same hashcode for entities with equal fields. But nevertheless equal objects are added in HashSet. Please take a look at the code below: </p>
  
  <pre><code>@Entity
  @Table(name = "account")
  public class Account {
      private int accountID;
      private String accountNumber;
      private float amount;
      private String currency;
      private Client clientID;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "account_id")
      public int getAccountID() {
          return accountID;
      }
  
      public void setAccountID(int accountID) {
          this.accountID = accountID;
      }
  
      @Column(name = "account_number")
      public String getAccountNumber() {
          return accountNumber;
      }
  
      public void setAccountNumber(String accountNumber) {
          this.accountNumber = accountNumber;
      }
  
      @Column(name = "amount")
      public float getAmount() {
          return amount;
      }
  
      public void setAmount(float amount) {
          this.amount = amount;
      }
  
  
      @Column(name = "currency")
      public String getCurrency() {
          return currency;
      }
  
      public void setCurrency(String currency) {
          this.currency = currency;
      }
  
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "client_id")
      public Client getClientID() {
          return clientID;
      }
  
      public void setClientID(Client clientID) {
          this.clientID = clientID;
      }
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (!(o instanceof Account)) return false;
  
          Account account = (Account) o;
  
          if (Float.compare(account.amount, amount) != 0) return false;
          if (!accountNumber.equals(account.accountNumber)) return false;
          if (!clientID.equals(account.clientID)) return false;
          if (!currency.equals(account.currency)) return false;
  
          return true;
      }
  
      @Override
      public int hashCode() {
          int result = accountNumber.hashCode();
          result = 31 * result + (amount != +0.0f ? Float.floatToIntBits(amount) : 0);
          result = 31 * result + currency.hashCode();
          result = 31 * result + clientID.hashCode();
          return result;
      }
  }
  </code></pre>