[jboss-user] [JBoss Seam] - Re: Using stateless beans generated by seam in standalone Ja

trickyvail do-not-reply at jboss.com
Thu Jul 12 17:03:31 EDT 2007


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#4063729

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063729



More information about the jboss-user mailing list