摘要: 指定配置文件与main运行生成 public class GeneratorSqlmap { public void generator() throws Exception { List<String> warnings = new ArrayList<String>(); boolean ove 阅读全文
posted @ 2019-12-07 15:00 钟。意 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 一对一 <!-- 关系映射 --> <!-- 1-1:自动映射 --> <select id="oneToOne" resultType="UserView"> select u.*,c.num from user u,card c where u.id=c.per_fk </select> <!- 阅读全文
posted @ 2019-12-07 14:55 钟。意 阅读(391) 评论(0) 推荐(0) 编辑
摘要: <foreach> <!-- foreach --> <delete id="delMulti" parameterType="java.util.List"> delete from user where id in <!--collection:输入参数为List集合时,必须写list, ite 阅读全文
posted @ 2019-12-07 14:39 钟。意 阅读(720) 评论(0) 推荐(0) 编辑
摘要: Mybatis映射文件 1.接口的全限定名和映射文件的namespace一致 <mapper namespace="com.offcn.dao.UserDao"> 2.接口的方法名和映射文件中statment的id一致:id是接口中的方法名include:是提取出使用次数较多的公共sql,引入外部的 阅读全文
posted @ 2019-12-07 14:29 钟。意 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 首先配置mybatis配置文件 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!- 阅读全文
posted @ 2019-12-07 14:09 钟。意 阅读(152) 评论(0) 推荐(0) 编辑