title: Why to use @AllArgsConstructor and @NoArgsConstructor together over an Entity?
body: <p>I have seen multiple codes online on applications of Spring Boot in IntelliJ, and many use both <code>@AllArgsConstructor</code> and <code>@NoArgsConstructor</code> together and both are constructors however the purpose of each is different -</p>
  <ul>
  <li><code>@AllArgsConstructor</code> generates a constructor requiring argument for every field in the annotated class</li>
  <li><code>@NoArgsConstructor</code> generates a constructor with no parameter</li>
  </ul>
  <p><em><strong>Then why are we using both together over the same entity and how do they function in such case?</strong></em></p>
  <pre class="lang-java prettyprint-override"><code>@Data
  @AllArgsConstructor
  @NoArgsConstructor
  @ToString
  @Entity
  public class Product {
      @Id
      private int id;
      private String name;
      private String type;
  }
  </code></pre>