Fork me on GitHub
摘要: beans.xml 配置文件 <!--不建议使用--> <!-- <bean id="user" class="com.jiang.pojo.user">--><!-- <constructor-arg index="0" value="岳不群"/>--><!-- </bean>--> <!-- < 阅读全文
posted @ 2024-03-16 22:41 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 缓存:mybatis中默认开启一级缓存sqlSession.clearCache(); 清除缓存<cache/> 开启二级缓存<cache type="org.apache.ibatis.cache.impl.PerpetualCache" size="1024" eviction="LRU" fl 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 动态sqlif 做判断拼接sql语句choose,when 类似于Java的switch判断set 修改语句专用,可以自动排错,比如多写了逗号sql,include 用于提取重复的语句,提高复用foreach 用于动态的查询多条信息 <!--if--> <select id="getBlogBy"> 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 连表查询多对一查询 <select id="findAll2" resultMap="a1"> SELECT s.`id` sid ,s.`name` sname ,t.`name` tname FROM `student` s ,`teacher` t WHERE s.`tid`=t.`id`</ 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(2) 评论(0) 推荐(0) 编辑

asd