static private Logger logger = Logger.getLogger(MeasureUnitDAOImpl.class);
public MeasureUnit loadMeasureUnitById(Integer id) throws EMFUserError {
logger.debug("IN");
MeasureUnit toReturn = null;
Session aSession = null;
Transaction tx = null;
try {
aSession = getSession();
tx = aSession.beginTransaction();
SbiMeasureUnit hibMeasureUnit = (SbiMeasureUnit) aSession.load(
SbiMeasureUnit.class, id);
toReturn = new MeasureUnit();
toReturn.setId(hibMeasureUnit.getIdMeasureUnit());
toReturn.setName(hibMeasureUnit.getName());
toReturn.setScaleCd(hibMeasureUnit.getScaleCd());
toReturn.setScaleNm(hibMeasureUnit.getScaleNm());
toReturn.setScaleTypeId(hibMeasureUnit.getScaleType().getValueId());
} catch (HibernateException he) {
logger.error("Error while loading the MeasureUnit with id "
+ ((id == null) ? "" : id.toString()), he);