FileDocCategorySizeDatePackage
CustomerDAOBean.javaAPI DocJBoss 4.2.11951Fri Jul 13 20:55:28 BST 2007org.jboss.tutorial.embeddedwar

CustomerDAOBean

public class CustomerDAOBean extends Object implements CustomerDAOLocal, CustomerDAORemote
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private EntityManager
em
Constructors Summary
Methods Summary
public intcreateCustomer(java.lang.String name)

      try 
      {
         java.lang.reflect.Method[] methods = EntityManager.class.getDeclaredMethods();
         
         Customer cust = new Customer();
         cust.setName(name);
         em.persist(cust);
         return cust.getId();
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      
      return -1;
   
public CustomerfindCustomer(int id)

      return em.find(Customer.class, id);