adam bien's blog

Six Essential Java EE 6 Annotations - Sufficient For CRUD 📎

From presentation to backend:
  1. @Model: (=@RequestScoped + @Named) directly exposes the backing bean into JSF 2 (or JSP)
  2. @Stateless: declares a POJO as Stateless Session Bean. You will need at least one boundary to manage transactions conveniently.
  3. @Inject: injects application "components" ("POJOs", Managed Beans, EJBs)
  4. @PersistenceContext: injects the EntityManager
  5. @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.