@Override public void updateAdoption(Adoption a) { em.getTransaction().begin(); Adoption target = em.find(Adoption.class, a.getId()); target.setCountry(a.getCountry()); target.setEventDate(a.getEventDate()); target.setPerson(a.getPerson()); target.setState_province(a.getState_province()); target.setTown(a.getTown()); target.setParents(a.getParents()); em.merge(target); em.getTransaction().commit(); }