MyBatis
_蒹葭苍苍
Everyone has his own dreams.My dream is to be a computer programmer.I think it's very interesting and exciting for me to work on.With the development of science and technology,people can imagin and swim freely in the world ofcomputers.Computers have become good partners and friends in the daily life
展开
-
Mapper method 'dao.xxx' has an unsupported return type
前后端分离,前端上传数据,后台一直报这个Mapper method 'dao.xxx' has an unsupported return type错误,后来才发现是不需要返回值结果的,把返回值类型改为void就行了,如果是添加等操作也可以改为int类型。...原创 2018-09-10 15:55:57 · 2581 阅读 · 1 评论 -
MyBatis 简介
MyBatis是一个数据持久层(ORM)框架。把实体类和SQL语句之间建立了映射关系,是一种半自动化的ORM实现。MyBatis的优点:1. 基于SQL语法,简单易学。2. 能了解底层组装过程。3. SQL语句封装在配置文件中,便于统一管理及维护,降低了程序的耦合度。4. 程序调试方便。 MyBatis的发展历史:1. MyBatis 本是apache的一个开源项目...原创 2018-09-13 11:11:01 · 536 阅读 · 0 评论 -
MyBatis 缓存机制
MyBatis将数据缓存设计成两级结构,分为一级缓存、二级缓存:1.1 一级缓存是Session会话级别的缓存,位于表示一次数据库会话的SqlSession对象之中,又被称之为本地缓存。一级缓存是MyBatis内部实现的一个特性,用户不能配置,默认情况下自动支持的缓存,用户没有定制它的权利(不过这也不是绝对的,可以通过开发插件对它进行修改);•1.2 二级缓存是Application应用级...原创 2018-09-13 19:14:08 · 210 阅读 · 0 评论 -
MyBatis的动态SQL
MyBatis中的动态sql(1) MyBatis 的强大特性之一便是它的动态 SQL。如果有使用JDBC或其他类似框架的经验,就能体会到根据不同条件拼接SQL语句的痛苦。拼接的时候要确保不能忘了必要的空格,还要注意省掉列名列表最后的逗号。利用动态SQL这一特性可以彻底摆脱这种痛苦;(2) 动态 SQL 元素和使用JSTL或其他类似基于 XML 的文本处理器相似。在 MyBatis 之前的...原创 2018-09-13 20:04:56 · 190 阅读 · 0 评论