BIObjectParameter biparam = (BIObjectParameter)iterBIParams.next();
IObjParuseDAO objparuseDao = DAOFactory.getObjParuseDAO();
List objparlist = objparuseDao.loadObjParuses(biparam.getId());
Iterator iterObjParuse = objparlist.iterator();
while(iterObjParuse.hasNext()) {
ObjParuse objparuse = (ObjParuse)iterObjParuse.next();
Transaction tx = session.beginTransaction();
// TODO controllare perch� serve questo controllo: le dipendenze non dovrebbero essere riutilizzabili, per
// cui vengono inseriti una sola volta
Query hibQuery = session.createQuery(" from SbiObjParuse where id.sbiObjPar.objParId = " + objparuse.getObjParId() +
" and id.sbiParuse.useId = " + objparuse.getParuseId() +
" and id.sbiObjParFather.objParId = " + objparuse.getObjParFatherId() +
" and id.filterOperation = '" + objparuse.getFilterOperation() + "'" );
List hibList = hibQuery.list();
if(!hibList.isEmpty()) {
continue;
}
// built key
SbiObjParuseId hibObjParuseId = new SbiObjParuseId();
SbiObjPar hibObjPar = (SbiObjPar)session.load(SbiObjPar.class, objparuse.getObjParId());
SbiParuse hibParuse = (SbiParuse)session.load(SbiParuse.class, objparuse.getParuseId());
SbiObjPar objparfather = (SbiObjPar)session.load(SbiObjPar.class, objparuse.getObjParFatherId());
hibObjParuseId.setSbiObjPar(hibObjPar);
hibObjParuseId.setSbiParuse(hibParuse);
hibObjParuseId.setFilterOperation(objparuse.getFilterOperation());
hibObjParuseId.setSbiObjParFather(objparfather);
SbiObjParuse hibObjParuse = new SbiObjParuse(hibObjParuseId);
hibObjParuse.setFilterColumn(objparuse.getFilterColumn());
hibObjParuse.setProg(objparuse.getProg());
hibObjParuse.setPreCondition(objparuse.getPreCondition());
hibObjParuse.setPostCondition(objparuse.getPostCondition());
hibObjParuse.setLogicOperator(objparuse.getLogicOperator());
session.save(hibObjParuse);
tx.commit();
}
}