use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method listByDataMediaPairId.
public List<ColumnPair> listByDataMediaPairId(Long dataMediaPairId) {
Assert.assertNotNull(dataMediaPairId);
List<ColumnPair> dataColumnPairs = new ArrayList<ColumnPair>();
try {
List<DataColumnPairDO> dataColumnPairDos = dataColumnPairDao.listByDataMediaPairId(dataMediaPairId);
if (dataColumnPairDos.isEmpty()) {
logger.debug("DEBUG ## couldn't query any dataColumnPair, maybe hasn't create any dataColumnPair.");
return dataColumnPairs;
}
dataColumnPairs = doToModel(dataColumnPairDos);
} catch (Exception e) {
logger.error("ERROR ## query dataColumnPair by dataMediaId:" + dataMediaPairId + " 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 modelToDo.
/**
* 用于Model对象转化为DO对象
*
* @param dataColumnPair
* @return DataMediaPairDO
*/
private DataColumnPairDO modelToDo(ColumnPair dataColumnPair) {
DataColumnPairDO dataColumnPairDo = new DataColumnPairDO();
dataColumnPairDo.setId(dataColumnPair.getId());
dataColumnPairDo.setSourceColumnName(dataColumnPair.getSourceColumn() == null ? null : dataColumnPair.getSourceColumn().getName());
dataColumnPairDo.setTargetColumnName(dataColumnPair.getTargetColumn() == null ? null : dataColumnPair.getTargetColumn().getName());
dataColumnPairDo.setDataMediaPairId(dataColumnPair.getDataMediaPairId());
dataColumnPairDo.setGmtCreate(dataColumnPair.getGmtCreate());
dataColumnPairDo.setGmtModified(dataColumnPair.getGmtModified());
return dataColumnPairDo;
}
use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method create.
public void create(ColumnPair entityObj) {
Assert.assertNotNull(entityObj);
try {
DataColumnPairDO dataColumnPairDo = modelToDo(entityObj);
dataColumnPairDao.insert(dataColumnPairDo);
} catch (RepeatConfigureException rcf) {
throw rcf;
} catch (Exception e) {
logger.error("ERROR ## create dataColumnPair has an exception!");
throw new ManagerException(e);
}
}
use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class IbatisDataColumnPairDAO method insertBatch.
public void insertBatch(List<DataColumnPairDO> dataColumnPairDos) {
try {
getSqlMapClientTemplate().getSqlMapClient().startBatch();
Iterator it = dataColumnPairDos.iterator();
while (it.hasNext()) {
DataColumnPairDO dataColumnPairDo = (DataColumnPairDO) it.next();
getSqlMapClientTemplate().getSqlMapClient().insert("insertDataColumnPair", dataColumnPairDo);
}
getSqlMapClientTemplate().getSqlMapClient().executeBatch();
} catch (SQLException ex1) {
ex1.printStackTrace();
}
}
use of com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO in project otter by alibaba.
the class DataColumnPairServiceImpl method createBatch.
public void createBatch(List<ColumnPair> dataColumnPairs) {
Assert.assertNotNull(dataColumnPairs);
try {
List<DataColumnPairDO> dataColumnPairDos = new ArrayList<DataColumnPairDO>();
for (ColumnPair columnPair : dataColumnPairs) {
DataColumnPairDO dataColumnPairDo = modelToDo(columnPair);
dataColumnPairDos.add(dataColumnPairDo);
}
dataColumnPairDao.insertBatch(dataColumnPairDos);
} catch (RepeatConfigureException rcf) {
throw rcf;
} catch (Exception e) {
logger.error("ERROR ## create dataColumnPair has an exception!");
throw new ManagerException(e);
}
}
Aggregations