|
@@ -19,7 +19,7 @@ package com.baomidou.mybatisplus.autoconfigure;
|
|
|
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
|
|
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
|
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
|
|
-import com.baomidou.mybatisplus.core.incrementer.SnowflakeIdGenerator;
|
|
|
+import com.baomidou.mybatisplus.core.incrementer.DefaultGenerator;
|
|
|
import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
|
|
|
import com.baomidou.mybatisplus.core.incrementer.IdGenerator;
|
|
|
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
|
@@ -257,9 +257,9 @@ public class MybatisPlusAutoConfiguration implements InitializingBean {
|
|
|
public IdGenerator idGenerator() {
|
|
|
GlobalConfig globalConfig = this.properties.getGlobalConfig();
|
|
|
if (globalConfig.getWorkerId() != null && globalConfig.getDatacenterId() != null) {
|
|
|
- return new SnowflakeIdGenerator(globalConfig.getWorkerId(), globalConfig.getDatacenterId());
|
|
|
+ return new DefaultGenerator(globalConfig.getWorkerId(), globalConfig.getDatacenterId());
|
|
|
}
|
|
|
- return new SnowflakeIdGenerator();
|
|
|
+ return new DefaultGenerator();
|
|
|
}
|
|
|
|
|
|
/**
|