Here is an example of an "Application-Managed Entity Manager" from the book
"Pro EJB 3"
public class EmployeeClient {
| public static void main(String[] args) {
| EntityManagerFactory emf =
Persistence.createEntityManagerFactory("EmployeeService");
| EntityManager em = emf.createEntityManager();
|
| Collection emps = em.createQuery("SELECT e FROM Employee e")
| .getResultList();
| for(Iterator i = emps.iterator(); i.hasNext();) {
| Employee e = (Employee) i.next();
| System.out.println(e.getId() + ", " + e.getName());
| }
|
| em.close();
| emf.close();
| } * from page 117
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063729#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...