* @param url
* @return supplierInfo
*/
@Transactional
public SupplierInfo updateSupplier(String supplierID, String name, String street, String city, String state, String zip, String phone, String url) {
SupplierInfo supplierInfo = null;
try {
Util.debug("SuppliersBean.updateSupplier() - Entered");
Supplier supplier = null;
/*
try { */
supplier = em.find(Supplier.class, supplierID);
if (supplier != null) {
// Create a new Supplier if there is NOT an existing Supplier.
// supplier = getSupplierLocalHome().findByPrimaryKey(new SupplierKey(supplierID));
supplier.setName(name);
supplier.setStreet(street);
supplier.setCity(city);
supplier.setUsstate(state);
supplier.setZip(zip);
supplier.setPhone(phone);
supplier.setUrl(url);
supplierInfo = new SupplierInfo(supplier);
em.persist(supplier);
em.flush();
} else { // catch (FinderException e) {
Util.debug("SuppliersBean.updateSupplier() - supplier doesn't exist.");
Util.debug("SuppliersBean.updateSupplier() - Couldn't update Supplier for SupplierID: " + supplierID);