提交 4088deb5 编写于 作者: M MaxKey

IdStrategy.DEFAULT

上级 0c532702
......@@ -10,4 +10,6 @@ public class IdStrategy {
public final static String SNOWFLAKEID = "snowflakeid";
public final static String DEFAULT = "default";
}
......@@ -27,10 +27,11 @@ public class IdentifierGeneratorFactory {
public static ConcurrentHashMap<String, IdentifierGenerator> generatorStrategyMap = new ConcurrentHashMap<String, IdentifierGenerator>();
public IdentifierGeneratorFactory() {
register(IdStrategy.UUID, new UUIDGenerator());
register(IdStrategy.UUIDHEX, new UUIDHexGenerator());
register(IdStrategy.SERIAL, new SerialGenerator());
register(IdStrategy.SNOWFLAKEID, new SnowFlakeIdGenerator());
register(IdStrategy.UUID , new UUIDGenerator());
register(IdStrategy.UUIDHEX , new UUIDHexGenerator());
register(IdStrategy.SERIAL , new SerialGenerator());
register(IdStrategy.SNOWFLAKEID , new SnowFlakeIdGenerator());
register(IdStrategy.DEFAULT , new SnowFlakeIdGenerator());
}
public IdentifierGeneratorFactory(long datacenterId, long machineId) {
......
......@@ -81,7 +81,7 @@ public class InsertProvider <T extends JpaBaseEntity>{
}else {
BeanUtil.set(entity,
fieldColumnMapper.getFieldName(),
MapperMetadata.identifierGeneratorFactory.generate(IdStrategy.SNOWFLAKEID));
MapperMetadata.identifierGeneratorFactory.generate(IdStrategy.DEFAULT));
sql.VALUES(fieldColumnMapper.getColumnName(),"#{" + fieldColumnMapper.getFieldName() + "}");
}
}else if(generatedValue.strategy()==GenerationType.SEQUENCE){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册