当前位置:Gxlcms >
数据库问题 >
MyBatis java and MySql local variables
MyBatis java and MySql local variables
时间:2021-07-01 10:21:17
帮助过:1人阅读
insert id="create" parameterType="models.entities.CategoryEntity">
set @catId := (select categoryId from Categories limit 1);
insert into Categories(CategoryId, Title, LeftValue, RightValue)
values(@catId, ‘Test in‘, 1,2);
....
</insert>
这种情况下需要设定db:
jdbc:mysql://localhost:3306/DBS?allowMultiQueries=true
MyBatis java and MySql local variables
标签: