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.
Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014 Tweet Follow @AdamBien