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

浙公网安备 33010602011771号