fix(sj_1.2.0-beta1): SnailJobMybatisConfiguration 补齐 DUPLICATE_IDS
This commit is contained in:
parent
90cea3bd31
commit
f0356cc5f0
@ -1,11 +1,6 @@
|
|||||||
package com.aizuda.snailjob.template.datasource.handler;
|
package com.aizuda.snailjob.template.datasource.handler;
|
||||||
|
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.JobLogMessageMapper;
|
import com.aizuda.snailjob.template.datasource.persistence.mapper.*;
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.JobSummaryMapper;
|
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.RetrySummaryMapper;
|
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.RetryTaskLogMessageMapper;
|
|
||||||
import com.aizuda.snailjob.template.datasource.persistence.mapper.RetryTaskMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||||
import org.apache.ibatis.mapping.MappedStatement;
|
import org.apache.ibatis.mapping.MappedStatement;
|
||||||
|
|
||||||
@ -25,17 +20,22 @@ public class SnailJobMybatisConfiguration extends MybatisConfiguration {
|
|||||||
*/
|
*/
|
||||||
static final Set<String> DUPLICATE_IDS = new HashSet<>();
|
static final Set<String> DUPLICATE_IDS = new HashSet<>();
|
||||||
|
|
||||||
|
private static final String BATCH_INSERT_ID = "insertBatch";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
DUPLICATE_IDS.add(JobSummaryMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(RetryDeadLetterMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
DUPLICATE_IDS.add(RetryTaskLogMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(ServerNodeMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
DUPLICATE_IDS.add(RetrySummaryMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(JobTaskMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
DUPLICATE_IDS.add(RetryTaskLogMessageMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(JobSummaryMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
DUPLICATE_IDS.add(RetryTaskMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(RetryTaskLogMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
DUPLICATE_IDS.add(JobLogMessageMapper.class.getName() + ".insertBatch");
|
DUPLICATE_IDS.add(RetrySummaryMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
|
DUPLICATE_IDS.add(RetryTaskLogMessageMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
|
DUPLICATE_IDS.add(RetryTaskMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
|
DUPLICATE_IDS.add(JobLogMessageMapper.class.getName() + "." + BATCH_INSERT_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addMappedStatement(final MappedStatement ms) {
|
public void addMappedStatement(MappedStatement ms) {
|
||||||
if (mappedStatements.containsKey(ms.getId())) {
|
if (mappedStatements.containsKey(ms.getId())) {
|
||||||
if (!DUPLICATE_IDS.contains(ms.getId())) {
|
if (!DUPLICATE_IDS.contains(ms.getId())) {
|
||||||
super.addMappedStatement(ms);
|
super.addMappedStatement(ms);
|
||||||
|
Loading…
Reference in New Issue
Block a user