dataSetId = sdkDataSet.getId();
logger.debug("Looking for dataset with id = " + dataSetId);
if (dataSetId == null){
logger.warn("DataSet with identifier [" + dataSetId + "] not found. Create it!");
IDataSetDAO dataSetDao = DAOFactory.getDataSetDAO();
dataSetDao.setUserProfile(profile);
toReturn = dataSetDao.insertDataSet(sbiDataset);
if (toReturn != null) {
logger.info("DataSet saved with id = " + toReturn);
} else {
logger.error("DataSet not modified!!");
}
}else{
logger.warn("DataSet with identifier [" + dataSetId + "] found. Modified it!");
IDataSetDAO datasetDAO = DAOFactory.getDataSetDAO();
datasetDAO.setUserProfile(profile);
datasetDAO.modifyDataSet(sbiDataset);
}
} catch(Exception e) {
logger.error("Error while saving dataset", e);
}