SpringBoot整合UidGenerator 通过mybatis-plus oracle版本

本文介绍了如何在SpringBoot 2.2.8.RELEASE项目中集成UidGenerator,并使用MyBatisPlus替代XML映射方式。详细步骤包括:替换work_node表结构和实体类,调整DisposableWorkerIdAssigner并将其注入为Service接口,以及建表、创建序列、触发器、实体类、Mapper接口、接口实现和配置类的详细操作。最后进行了测试验证。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.SpringBoot整合百度开源UidGenerator 并且替换默认的xml映射的方式为MyBatisPlus

2.SpringBoot版本为 2.2.8.RELEASE;MyBatisPlus版本为 3.3.2;UidGenerator版本为1.0.0-SNAPSHOT

3.替换默认的work_node 表结构和对应的实体类

4.替换默认的DisposableWorkerIdAssigner 并且修改注入的mapper接口为service接口

第一步 打包后

<dependency>
	<groupId>com.baidu.fsg</groupId>
	<artifactId>uid-generator</artifactId>
	<version>${uid-generator.version}</version>
	<exclusions>
		<exclusion>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis-spring</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>com.baomidou</groupId>
	<artifactId>mybatis-plus-boot-starter</artifactId>
	<version>${mybatis-plus.version}</version>
</dependency&g
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值