try {
aSession = getSession();
tx = aSession.beginTransaction();
SbiChecks hibCheck = (SbiChecks) aSession.load(SbiChecks.class,
check.getCheckId());
Criterion aCriterion = Expression.and(Expression.eq("valueId",
check.getValueTypeId()), Expression.eq("valueCd", check
.getValueTypeCd()));
Criteria criteria = aSession.createCriteria(SbiDomains.class);
criteria.add(aCriterion);
SbiDomains aSbiDomains = (SbiDomains) criteria.uniqueResult();
if (aSbiDomains == null){
SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
"CheckDAOHibImpl",
"modifyCheck",
"The Domain with value_id="+check.getValueTypeId()+" and value_cd="+check
.getValueTypeCd()+" does not exist.");
throw new EMFUserError(EMFErrorSeverity.ERROR, 1036);
}
hibCheck.setDescr(check.getDescription());
hibCheck.setName(check.getName());
hibCheck.setLabel(check.getLabel());
hibCheck.setValue1(check.getFirstValue());
hibCheck.setValue2(check.getSecondValue());
hibCheck.setCheckType(aSbiDomains);
hibCheck.setValueTypeCd(aSbiDomains.getValueCd());
updateSbiCommonInfo4Update(hibCheck);
tx.commit();
} catch (HibernateException he) {
logException(he);