package com.product.data.center.entity;
|
|
import com.product.core.entity.DataTableEntity;
|
import com.product.data.center.utils.CallBackReturnValue;
|
import com.product.datasource.entity.DataBaseEntity;
|
import com.product.util.CallBack;
|
|
/**
|
* 批处理配置
|
*/
|
public class BatchConfigEntity {
|
|
/**
|
* 来源数据库连接信息
|
*/
|
private DataBaseEntity sourceDbe;
|
|
/**
|
* 目标数据库连接信息
|
*/
|
private DataBaseEntity targetDbe;
|
/**
|
* 查询数据
|
*/
|
private QueryDataConfigEntity queryEntity;
|
|
/**
|
* 数据查询后处理回调接口
|
*/
|
private CallBackReturnValue<DataTableEntity, DataTableEntity> dataDispose;
|
/**
|
* 每批次处理插入的数量
|
*/
|
private int batchDisposeSize = 2000;
|
/**
|
* 批次插入错误处理回调
|
*/
|
private CallBack<BatchExecuteEntity> batchError;
|
|
/**
|
* 错误后继续
|
*/
|
private boolean errorContinue = true;
|
|
|
/**
|
* @param sourceDbe 来源数据库连接信息
|
* @param targetDbe 目标数据库连接信息
|
* @param queryEntity 查询数据sql
|
* @param dataDispose 数据查询后处理回调接口
|
* @param batchError 批次插入错误处理回调
|
* @param errorContinue 错误后继续
|
*/
|
public BatchConfigEntity(DataBaseEntity sourceDbe,
|
DataBaseEntity targetDbe,
|
QueryDataConfigEntity queryEntity,
|
CallBackReturnValue<DataTableEntity, DataTableEntity> dataDispose,
|
CallBack<BatchExecuteEntity> batchError,
|
boolean errorContinue) {
|
this.sourceDbe = sourceDbe;
|
this.targetDbe = targetDbe;
|
this.queryEntity = queryEntity;
|
queryEntity.setDbt(sourceDbe.getDataBaseType());
|
this.dataDispose = dataDispose;
|
this.batchError = batchError;
|
this.errorContinue = errorContinue;
|
}
|
|
/**
|
* @param sourceDbe 来源数据库连接信息
|
* @param targetDbe 目标数据库连接信息
|
* @param queryEntity 查询数据sql
|
* @param dataDispose 数据查询后处理回调接口
|
* @param batchDisposeSize 每批次处理插入的数量
|
* @param batchError 批次插入错误处理回调
|
* @param errorContinue 错误后继续
|
*/
|
public BatchConfigEntity(DataBaseEntity sourceDbe,
|
DataBaseEntity targetDbe,
|
QueryDataConfigEntity queryEntity,
|
CallBackReturnValue<DataTableEntity, DataTableEntity> dataDispose,
|
int batchDisposeSize,
|
CallBack<BatchExecuteEntity> batchError,
|
boolean errorContinue) {
|
this.sourceDbe = sourceDbe;
|
this.targetDbe = targetDbe;
|
this.queryEntity = queryEntity;
|
queryEntity.setDbt(sourceDbe.getDataBaseType());
|
this.dataDispose = dataDispose;
|
this.batchDisposeSize = batchDisposeSize;
|
this.batchError = batchError;
|
this.errorContinue = errorContinue;
|
}
|
|
public DataBaseEntity getSourceDbe() {
|
return sourceDbe;
|
}
|
|
public void setSourceDbe(DataBaseEntity sourceDbe) {
|
this.sourceDbe = sourceDbe;
|
}
|
|
public QueryDataConfigEntity getQueryEntity() {
|
return queryEntity;
|
}
|
|
public DataBaseEntity getTargetDbe() {
|
return targetDbe;
|
}
|
|
public void setTargetDbe(DataBaseEntity targetDbe) {
|
this.targetDbe = targetDbe;
|
}
|
|
public void setQueryEntity(QueryDataConfigEntity queryEntity) {
|
this.queryEntity = queryEntity;
|
}
|
|
public CallBackReturnValue<DataTableEntity, DataTableEntity> getDataDispose() {
|
return dataDispose;
|
}
|
|
public void setDataDispose(CallBackReturnValue<DataTableEntity, DataTableEntity> dataDispose) {
|
this.dataDispose = dataDispose;
|
}
|
|
public int getBatchDisposeSize() {
|
return batchDisposeSize;
|
}
|
|
public void setBatchDisposeSize(int batchDisposeSize) {
|
this.batchDisposeSize = batchDisposeSize;
|
}
|
|
public CallBack<BatchExecuteEntity> getBatchError() {
|
return batchError;
|
}
|
|
public void setBatchError(CallBack<BatchExecuteEntity> batchError) {
|
this.batchError = batchError;
|
}
|
|
public boolean isErrorContinue() {
|
return errorContinue;
|
}
|
|
public void setErrorContinue(boolean errorContinue) {
|
this.errorContinue = errorContinue;
|
}
|
|
}
|