title: How to use @EqualsAndHashCode With Include - Lombok
body: <p>How to use <code>@EqualsAndHashCode</code> With <code>Include</code>,  Lombok library for Java.</p>
  
  <pre><code>@EqualsAndHashCode.Include( )
  </code></pre>
  
  <p>How to make Equals compare the class id?</p>
  
  <p>Example:</p>
  
  <pre><code>@EqualsAndHashCode.Include( )
  @Table(name = "USER")
  public class User
  {
  
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "IDENTITY_USER")
    private Long identity;
  }
  </code></pre>