FileDocCategorySizeDatePackage
CustomerDAOBean.javaAPI DocJBoss 4.2.12020Fri Jul 13 20:54:46 BST 2007org.jboss.tutorial.secondary.bean

CustomerDAOBean

public class CustomerDAOBean extends Object implements CustomerDAO

Fields Summary
private EntityManager
manager
Constructors Summary
Methods Summary
public intcreate(java.lang.String first, java.lang.String last, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zip)

      Customer customer = new Customer(first, last, street, city, state, zip);
      manager.persist(customer);
      return customer.getId();
   
public Customerfind(int id)

      return manager.find(Customer.class, id);
   
public java.util.ListfindByLastName(java.lang.String name)

      return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
   
public voidmerge(Customer c)

      manager.merge(c);