mybatis
nicedaych
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
mybatis更新数据时只更新部分字段的问题
问题 在mybatis更新数据时,传入的是一个对象,但是有时候只是更新这个对象中的某些字段,并不是全部字段,如果使用如下方式更新,则有些字段则会被更新为null。 <update id="updateEmp" parameterType="com.mytest.mybatis.entity.Employee"> update tbl_employee set last_name = #{lastName}, email = #{email}, gender = #{gender}, ag原创 2020-05-14 21:47:02 · 13454 阅读 · 1 评论 -
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_c
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation ‘=’ 在使用mybatis向数据库中插入数据时报此错误信息,通过报错信息可以看到是字符编码混淆。 <insert id="addEmp" parameterType="com.mytest.mybatis.entity.Employee">原创 2020-05-14 20:35:27 · 5559 阅读 · 0 评论
分享