1:MyBatis核心对象(生命周期与作用域)

SqlSessionFactoryBuilder

SqlSessionFactory

SqlSession

通过SqlSession实例直接执行已映射的SQL语句

基于Mapper接口方式操作数据

2:MyBatis核心配置文件

(mybatis-config.xml)

properties元素

settings元素

typeAliases元素

environments元素

dataSource 数据源

transactionManager 事务管理器

mappers元素

3:MyBatis-SQL映射文件(mapper.xml)

            namespace

            insert、update、delete、select元素

                     id :唯一标识

                     parameterType:直接表示参数类型 使用@Param实现多参数入参

                     resultType :直接表示返回类型

                     resultMap :表示对外部resultMap的引用

            resultMap元素

               属性 id,type

            子节点

                 id, result, association ,collection

            动态SQL

                 if ,where ,set ,trim ,foreach ,choose(when、otherwise)

 

posted on 2020-10-21 16:23  吅^O^  阅读(50)  评论(0编辑  收藏  举报