}
return model;
}
private DebtModel load(CharacteristicDao dao) {
DefaultDebtModel debtModel = new DefaultDebtModel();
List<CharacteristicDto> allCharacteristics = dao.selectEnabledCharacteristics();
for (CharacteristicDto dto : allCharacteristics) {
Integer parentId = dto.getParentId();
if (parentId == null) {
debtModel.addCharacteristic(toDebtCharacteristic(dto));
} else {
debtModel.addSubCharacteristic(toDebtCharacteristic(dto), characteristicById(parentId, allCharacteristics).getKey());
}
}
return debtModel;
}