try {
final CHEMRFacilityMedicalEquipment medicalequ = m_chemrFacilityMedicalEquipmentManagementBO
.findCHEMRFacilityMedicalEquipmentById(id);
final CHEMRFacilityMedicalEquipment updateMed = new CHEMRFacilityMedicalEquipment();
if (medicalequ.getMetaStatus() == true) {
updateMed.setId(medicalequ.getId());
updateMed.setMetaStatus(false);
m_chemrFacilityMedicalEquipmentManagementBO
.updateCHEMRFacilityMedicalEquipment(updateMed);
return true;
}
return false;
}
Above is how I am Calling my method in DaOImpl
try {
m_sessionFactory.getCurrentSession().update(instance);
} catch (final DataAccessException _e) {
M_LOG.debug("Update object failed:" + _e.toString());
throw new CHEMRDAOException(_e.toString());
} catch (final Exception _e) {
M_LOG.debug("Update object failed:" + _e.toString());
throw new CHEMRDAOException(_e.toString());
}
}
DAO Impimentation
I am trying to update my Object and sending it through the update mehtod to Update data in table. While I am calling update method it returns "a different object with the same identifier value was already associated with the session" Not getting what exactly the problem is.
updateMed.setId. You should not do it. - SternK