CustomerDAOBeanpublic class CustomerDAOBean extends Object implements CustomerDAO
Fields Summary |
---|
private EntityManager | manager |
Methods Summary |
---|
public int | create(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 Customer | find(int id)
return manager.find(Customer.class, id);
| public java.util.List | findByLastName(java.lang.String name)
return manager.createQuery("from Customer c where c.name.last = :name").setParameter("name", name).getResultList();
| public void | merge(Customer c)
manager.merge(c);
|
|