toTransform = aSession.createQuery("from SbiKpi").list();
}
for (Iterator iterator = toTransform.iterator(); iterator.hasNext();) {
SbiKpi hibKpi = (SbiKpi) iterator.next();
Kpi kpi = new Kpi();
kpi.setCode(hibKpi.getCode());
kpi.setDescription(hibKpi.getDescription());
kpi.setKpiName(hibKpi.getName());
kpi.setKpiId(hibKpi.getKpiId());
if(hibKpi.getSbiThreshold() != null){
Threshold threshold = new Threshold();
threshold.setId(hibKpi.getSbiThreshold().getThresholdId());
threshold.setName(hibKpi.getSbiThreshold().getName());
kpi.setThreshold(threshold);
}
toReturn.add(kpi);
}
} catch (HibernateException he) {