mybatis
张序员
这个作者很懒,什么都没留下…
展开
-
使用map接受mybatis返回结果
1,用List<Map>接收,类似于List<Bean>(一条或多条记录)2,直接用Map接收(一条记录)Mapper (DAO)List<Map> getBybid(Integer bid);Mapper.xml<select id="getBybid" resultType="java.util.Map" parameterType="Integer&quo原创 2018-03-23 17:35:47 · 5775 阅读 · 0 评论 -
mapper.xml注释引起SQLException的问题
错误的注释: <select id="select" resultMap="BaseResultMap" parameterType="java.lang.String"> select * from user where name = #{name,jdbcType=VARCHAR}; -- SELECT u.* FROM test.user u,test2....原创 2019-07-01 16:41:50 · 207 阅读 · 0 评论 -
日志类为什么用private static final?
private,只给自己用;static只会在类加载时创建一个;final 不可更改,为常量,高效。参考: mybatis、lombok等都是设置的private static final 的, 类型为类名 mybatis的sql打印虽然在内部生成,但是log是根据MappedStatement.Builder()中mappedStatement.stat...原创 2019-07-24 10:44:22 · 583 阅读 · 0 评论