Using JPA entities in JSF. Which is the best strategy to prevent LazyInitializationException?
You should provide exactly the model the view expects. If the JPA entity happens to match exactly the needed model, then just use it right away. If the JPA entity happens to have too few or too much properties, then use a DTO (subclass) and/or a constructor expression with a more specific JPQL query, if … Read more