use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method listByDataMediaPairIds.
public Map<Long, List<ColumnPair>> listByDataMediaPairIds(Long... dataMediaPairIds) {
Assert.assertNotNull(dataMediaPairIds);
Map<Long, List<ColumnPair>> dataColumnPairs = new HashMap<Long, List<ColumnPair>>();
try {
List<DataColumnPairDO> dataColumnPairDos = dataColumnPairDao.listByDataMediaPairIds(dataMediaPairIds);
if (dataColumnPairDos.isEmpty()) {
logger.debug("DEBUG ## couldn't query any dataColumnPair, maybe hasn't create any dataColumnPair.");
return dataColumnPairs;
}
for (DataColumnPairDO dataColumnPairDo : dataColumnPairDos) {
List<ColumnPair> columnPairs = dataColumnPairs.get(dataColumnPairDo.getDataMediaPairId());
if (columnPairs != null) {
if (!columnPairs.contains(doToModel(dataColumnPairDo))) {
columnPairs.add(doToModel(dataColumnPairDo));
}
} else {
columnPairs = new ArrayList<ColumnPair>();
columnPairs.add(doToModel(dataColumnPairDo));
dataColumnPairs.put(dataColumnPairDo.getDataMediaPairId(), columnPairs);
}
}
} catch (Exception e) {
logger.error("ERROR ## query dataColumnPair by dataMediaId:" + dataMediaPairIds + " has an exception!");
throw new ManagerException(e);
}
return dataColumnPairs;
}
use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method findById.
public ColumnPair findById(Long identity) {
Assert.assertNotNull(identity);
DataColumnPairDO columePairDo = dataColumnPairDao.findById(identity);
if (columePairDo == null) {
return null;
}
return doToModel(columePairDo);
}
use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method modify.
public void modify(ColumnPair entityObj) {
Assert.assertNotNull(entityObj);
try {
DataColumnPairDO dataColumnPairDo = modelToDo(entityObj);
dataColumnPairDao.update(dataColumnPairDo);
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## modify dataColumnPair has an exception!");
throw new ManagerException(e);
}
}
Aggregations