首页 > 数据库技术 > 详细

MyBatis java and MySql local variables

时间:2015-07-23 19:44:10      阅读:183      评论:0      收藏:0      [点我收藏+]
<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

原文:http://www.cnblogs.com/voctrals/p/4671389.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!