Ejb Tutorial Home
- Introduction to EJB 3 with movies
- Set Up the EJB 3 environment with Movies
- Creating the J2EE Project
- Inspecting the J2EE Project
- Create Session Bean skeleton:
- Create Entity Bean:
- Create the Session Bean POJI
- Define the POJI methods
- The EntityManager:
- Coding the business methods:
- Configure Persistence Unit
- Struts - a quick overview:
- Create the Struts Web layer:
- The Struts configuration file:
- The execute method:
- The insert & delete methods
- JSP body
- Deploy, review database and Test:
- Example Code
- Example Code
- Members (3267)
- Member Articles ( 1 )
- Discussion (3)
- Q & A ( 12 )
- - Ask Question
- - Questions
- - Unanswered Questions
Compared to EJB2, EJB3 is easy.
You still get all the heavyweight transaction management, clustering, caching, messaging etc but the actual creation of the components is greatly simplified.
In EJB3 we wave goodbye to deployment descriptors, ejbCreate, ejbPostCreate methods, and the callbacks ejbActivate , ejbPassivate , ejbRemove along with setting of session and entity contexts.
We say hello to javabean style Entity Beans and implementing just our business methods on Session Beans.
All necessary deployment information is declared as JDK 5.0 annotations removing the need for deployment descriptors.
Session Beans no longer implement the SessionBean interface and the EJBObject and EJBLocalObject interfaces are replaced by a simple business interface (POJI). Fact is, you don't need to write an interface for a session bean as, if missing, the server will generate one for you!
An EJB3 Entity Bean is no longer required to implement any interface or callback methods and terms like "Container Managed" and "Bean Managed" are replaced by annotated POJOs and an EntityManager to handle persistence.