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)
System.out.println("-- CustomerDAOBean.create()");
Customer customer = new Customer(first, last, street, city, state, zip);
manager.persist(customer);
return customer.getId();
|
public void | delete(java.util.List l)
System.out.println("-- CustomerDAOBean.delete()");
for (Iterator it = l.iterator() ; it.hasNext() ; )
{
Customer c = (Customer)it.next();
manager.remove(c);
}
|
public Customer | find(int id)
System.out.println("-- CustomerDAOBean.find()");
return manager.find(Customer.class, id);
|
public java.util.List | findByLastName(java.lang.String last)
System.out.println("-- CustomerDAOBean.findByLastName(id)");
return manager.createQuery("from Customer c where c.last = :last").setParameter("last", last).getResultList();
|
public void | merge(Customer c)
System.out.println("-- CustomerDAOBean.merge()");
manager.merge(c);
|
public void | postConstructCallback()
System.out.println("PostConstruct - Have EntityManager: " + (manager != null));
|
public void | preDestroyCallback()
System.out.println("PreDestory - Have EntityManager: " + (manager != null));
|