Most programers agree for avoiding DAO pattern when using JPA entities. Indeed, as a simple POJO, any entity can be merely persistent using annotations.
However, in the case where conceptual domain objects are slightly different from physical domain objects (reflecting database table), is it a good practice to use a “Business Object” representing conceptual model and delegate persisting operation to a “data storage object”? Thus, Business Object would be exempt from JPA annotations because it would be now the responsibility of the data storage object.
What is the best practice to deal with some differences between conceptual and physical domain? Should I introduce DAO pattern in order to convert each BO to “data storage object” and apply persisting operations on it?
From my understanding data transfer objects etc. aren’t needed anymore. You can achieve a lot with JPA annotations even if your database is different than your domain model. It is however best practice to keep data model and domain model in sync.