-
Book Overview & Buying
-
Table Of Contents
EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g
By :
In EJB 2.0, an entity bean is created with the create method in the home/local home interface and the entity bean fields are modified with the getter/setter methods in the local/remote interface. In EJB 3.0, an entity bean is created and modified with the EntityManager API. The EntityManager class provides methods for finding, persisting, and removing an entity bean instance. This section covers generation of a session bean that implements the EntityManager API.
In the session bean class, the EntityManager is obtained with the @Resource annotation:
@Resource private EntityManager em;
Some of the commonly used methods of the EntityManager class are listed in the following table:
|
EntityManager Method |
Description |
|---|---|
|
|
Saves an entity bean instance in the database. The persist method returns the entity bean that is persisted in the database. |
|
|
Finds an entity bean instance with a primary key... |
Change the font size
Change margin width
Change background colour