This leads to the Entity Bean class, so I try to avoid such a construct using Value Objects and Data Transfer Objects.
Why? What is the problem that justifies such cruel copying of code?
A “Data Transfer Object” and the misuse of the “Value Object” name are antipatterns that were needed with EJB 2 Entity Beans to avoid excessive server visits.
If you use JPA, you do not have a beans entity. Your POJO entities, and there is absolutely nothing wrong with exposing them to a client - in fact, this is one of the best things about JPA.
source share