Adam Bien's Weblog
Six Essential Java EE 6 Annotations - Sufficient For CRUD
From presentation to backend:
- @Model: (=@RequestScoped + @Named) directly exposes the backing bean into JSF 2 (or JSP)
- @Stateless: declares a POJO as Stateless Session Bean. You will need at least one boundary to manage transactions conveniently.
- @Inject: injects application "components" ("POJOs", Managed Beans, EJBs)
- @PersistenceContext: injects the EntityManager
- @Entity (and @Id to denote a PK): make a class persistent
The annotations above are sufficient to start with Java EE 6 and implement a CRUD webapplication with JSR 2, EJB 3.1, CDI, JPA 2.
NEW workshop: Microservices with Java EE 7 and Java 8, January 26th, 2015, Airport Munich