随笔分类 -  mybatis

摘要:mybatis.type-aliases-package=com.xxx.entity 指定别名 mybatis.mapper-locations=classpath:mybatis/mappings/**/*.xml 指定mapper映射路径 mybatis.configuration.cache 阅读全文
posted @ 2020-06-10 18:57 coolw 阅读(675) 评论(0) 推荐(0)
摘要:背景: 日常开发中,如果新建表,手动敲写model、dao和对应的mapper.xml文件,费时费力且容易出错, 所以采用mybatis自动生成model、dao及对应的mapper.xml文件。代码注释风格采用自定义注释。 环境: jdk1.8,maven,mysql 项目结构: mbg-comm 阅读全文
posted @ 2019-12-13 09:27 coolw 阅读(1978) 评论(0) 推荐(0)
摘要:第一种方案:下标传参 DAO层的函数方法 Public User selectUser(String name, String area); 对应的Mapper.xml <select id="selectUser" resultMap="BaseResultMap"> select * from 阅读全文
posted @ 2019-10-29 14:03 coolw 阅读(191) 评论(0) 推荐(0)