You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/04 06:15:44 UTC

[GitHub] [incubator-shardingsphere] steveNash12 commented on issue #1602: 整合mybatis之后,导致mybatis Mapper死循环-[八百里加急]

steveNash12 commented on issue #1602: 整合mybatis之后,导致mybatis Mapper死循环-[八百里加急]
URL: https://github.com/apache/incubator-shardingsphere/issues/1602#issuecomment-469131767
 
 
   @Repository
   @Mapper
   public interface UserRoleMapper extends BaseMapper<UserRole> {
       // 在@Select中定义更新数据库语句
       @Select("INSERT INTO `user_role`(`username`, `role_name`) VALUES (#{userRole.username}, #{userRole.roleName})")
       Integer insertBySelect(@Param("userRole") UserRole userRole);
   }
   
   你要插入数据,但是用的 select  注解,改成@insert 应该就好了。
   我也没注意 update的时候写成了select。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services