public Threshold toThreshold(SbiThreshold t) throws EMFUserError {
logger.debug("IN");
Threshold toReturn = new Threshold();
Integer id=t.getThresholdId();
String name=t.getName();
String description=t.getDescription();
String code=t.getCode();
SbiDomains d=t.getThresholdType();
toReturn.setId(id);
toReturn.setName(name);
toReturn.setDescription(description);
toReturn.setCode(code);
toReturn.setThresholdTypeId(d.getValueId());
toReturn.setThresholdTypeCode(d.getValueCd());
// get all the threshold Values
IThresholdValueDAO thValuesDao=(IThresholdValueDAO)DAOFactory.getThresholdValueDAO();
Set set=t.getSbiThresholdValues();
ArrayList thValues=new ArrayList();
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
SbiThresholdValue sbiThValue = (SbiThresholdValue) iterator.next();
thValues.add(thValuesDao.toThresholdValue(sbiThValue));
}
toReturn.setThresholdValues(thValues);
logger.debug("OUT");
return toReturn;
}