常见错误
追光的人(陈聪)
这个作者很懒,什么都没留下…
展开
-
mybatis--关于接口参数注解的几个小问题
接口中参数有多个的情况下,一般有两种方法进行配置。第一种是封装到一个类中,第二种是直接在接口形式参数前面写注解。 这里说下第二种容易出错的地方。 拼接字符串的时候常常需要用到where,foreach等语句 然而: ①接口中有方法: List<User> selectByIdAndUsername(@Param("id1") int id,@Param("username1") String username); <select id="selectByIdAndUsern原创 2021-05-25 23:30:22 · 162 阅读 · 0 评论 -
Mybatis--关于插入数据后返回id的操作
如果xml仅仅只是这样写的话: <insert id="insertUser" > insert into user(username,birthday,sex,address) VALUES (#{username},#{birthday},#{sex},#{address}) </insert> 并且执行以下代码的话 static void function2() throws IOException { String path原创 2021-05-25 22:15:14 · 875 阅读 · 1 评论 -
++x 和 x++的区别
int x =100; x =x++; x的值仍旧是100 x=++x; x的值变为101 是因为变量存在缓存机制 在计算x = x++时经过以下几个步骤: x=temp; x++; x=temp;原创 2021-03-10 20:26:36 · 380 阅读 · 0 评论 -
编码GBK的不可映射字符
解决方法:文件另存为时选择ANSI格式保存原创 2021-03-10 20:08:48 · 68 阅读 · 0 评论