try {
this.logger.logDebug("getting surgery by remote id");
Session currentSession = FacadeDB.getInstance().getCurrentSession();
Criteria criteria = currentSession.createCriteria(
SurgeryRemote.class).add(Restrictions.eq("remoteId", remoteId)).setMaxResults(1);
SurgeryRemote surgeryRemote = (SurgeryRemote) criteria.uniqueResult();
this.logger.logDebug("get successfully");
return (surgeryRemote != null ? surgeryRemote.getSurgery() : null);
} catch (HibernateException e) {
this.logger.logError("error on get surgery by remote id, msg: " + e.getMessage());
throw new ExceptionDAO("No se pudieron obtener las cirugias", e.fillInStackTrace());
}
}