Why to use @AllArgsConstructor and @NoArgsConstructor together over an Entity?
The JPA specification requires that all persistent classes (@Entity) have a no-arg constructor, public or protected. (note that this is not necessarily true when dealing with some implementation like Hibernate, see this answer). This is needed because JPA uses the default constructor method to create a bean class using the reflection API. Indeed if your … Read more