摘要:
Mybatis使用bind元素进行模糊查询,不用在乎数据库是mysql还是oracle从而提高可移植性 使用bind元素传递多个参数 阅读全文
摘要:
如果条件成立并且没有trim标签,那么sql语句就为 select from t_user AND role_name= {roleName} 现在有了trim标签,prefix表示在红色代码前面添加where,prefixoverride表示把最前面的and删除.那么代码就变为 select fr 阅读全文
摘要:
这样就能实现延迟加载但是不够彻底,因为Mybatis默认加载同一层级的所有成员。 这句话什么意思呢? 假如studentSelfcard这个成员被调的时候,studentLecturesList这个成员也会被调用,因为他们两是同一层级的,但是假如studentLecturesList下面还有< 阅读全文
摘要:
一对一 假如有student表(学生表)和student_card表(学生证表)。 student表中有一个字段self_card用来查student_card,student_card表中有一个student_id用来查student。 在Student的pojo类中,成员self_card被替换 阅读全文
摘要:
Idea 单模块 1.在pom.xml中添加依赖 2.创建generatorConfig.xml文件 3.RUN Edit Configurations... 在Command line:填入mybatis generator:generate 在回到界面点及RUN。 Idea多模块逆向 1.添加插 阅读全文