MybatisPlusConfigurer.java 配置
@Configuration
@MapperScan("demo.mapper")
public class MybatisPlusConfigurer {
/**
* Sequence序列
*/
@Bean
public OracleKeyGenerator oracleKeyGenerator(){
return new OracleKeyGenerator();
}
}
@TableName("T_DEMO")
@KeySequence(value = "SEQ_USER", clazz = Long.class)
public class Demo extends Model<Demo> {
/**
* ID
*/
@TableId(value = "ID", type = IdType.INPUT)
private Long id;
}
Mybatis Plus 3 需要配置 OracleKeyGenerator。