List hibObjectPars = hqlQuery.list();
SbiObjPar hibObjPar = null;
Iterator it = hibObjectPars.iterator();
BIObjectParameter tmpBIObjectParameter = null;
BIObjectParameterDAOHibImpl aBIObjectParameterDAOHibImpl = new BIObjectParameterDAOHibImpl();
IParameterDAO aParameterDAO = DAOFactory.getParameterDAO();
List biObjectParameters = new ArrayList();
Parameter aParameter = null;
int count = 1;
while (it.hasNext()) {
hibObjPar = (SbiObjPar) it.next();
tmpBIObjectParameter = aBIObjectParameterDAOHibImpl.toBIObjectParameter(hibObjPar);
//*****************************************************************
//**************** START PRIORITY RECALCULATION *******************
//*****************************************************************
Integer priority = tmpBIObjectParameter.getPriority();
if (priority == null || priority.intValue() != count) {
logger.warn("The priorities of the biparameters for the document with id = " + biObject.getId() + " are not sorted. Priority recalculation starts.");
aBIObjectParameterDAOHibImpl.recalculateBiParametersPriority(biObject.getId(), aSession);
tmpBIObjectParameter.setPriority(new Integer(count));
}
count++;
//*****************************************************************
//**************** END PRIORITY RECALCULATION *******************
//*****************************************************************
aParameter = aParameterDAO.loadForExecutionByParameterIDandRoleName(
tmpBIObjectParameter.getParID(), role);
tmpBIObjectParameter.setParID(aParameter.getId());
tmpBIObjectParameter.setParameter(aParameter);
biObjectParameters.add(tmpBIObjectParameter);
}