The Feature Pack for EJB 3.0 implements the Enterprise JavaBeans (EJB) Version 3.0 and Java Persistence API (JPA) specifications.
Using annotations and resource injection simplifies code.
This ensures full support for inheritance and polymorphism.
The JPA specification provides a new persistence framework that is based on successful industry patterns. JPA uses a simple object relational mapping layer over the top of a typical Java Database Connectivity (JDBC) resource usage pattern. JPA uses simple JavaBeans classes or POJO to represent relational database content, which is suitable for most Java developers. You can use basic resource access patterns to fetch and store state in the database while using POJO classes instead of JDBC persistence APIs.
@Stateful public class Cart3Bean implements ShoppingCart { private ArrayList contents = new ArrayList(); public void addToCart (Object o) { contents.add(o); } public Collection getContents() { return contents; } }The stateful annotation defines this component as a stateful session bean. By default, a single interface implemented by a bean defaults to a local business interface and its methods default to a transaction attribute of Required. It is no longer necessary to create XML deployment descriptors when using the EJB 3.0 feature pack.
Since the class only implements application-defined interfaces and methods, you can easily test your applications outside of the container using typical JUnit-style test patterns. This increases rapid development productivity by reducing the edit-compile-deploy-debug cycles that are associated with Java 2 Platform, Enterprise Edition (J2EE) applications.
There are no migration issues associated with installing the Feature Pack for EJB 3.0. Existing applications should continue to run as is and compile without errors.