public void Delete(Produto obj) throws Exception { try { transaction = manager.getTransaction(); transaction.begin(); manager.remove(obj); transaction.commit(); } catch (Exception ex) { transaction.rollback(); throw ex; } }
public Produto Open(int id) throws Exception { try { return manager.find(Produto.class, id); } catch (Exception ex) { throw ex; } }