Chapter 6. Enterprise Java Beans
The previous chapter showed how to implement persistent objects using JPA and how to query them with JPQL. The persistence layer is developed using objects that encapsulate and map their attributes to a relational database, thanks to annotations. The idea is to keep the entities as transparent as possible and not intermingle them with business logic. Entities can have methods to validate their attributes, but they are not made to represent complex tasks, which often require an interaction with other components (other persistent objects, external services, etc.).
The persistence layer is not the appropriate layer for business processing. Similarly, the user interface should not perform business logic, especially ...
Get Beginning Java™ EE 6 Platform with GlassFish™ 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.