zoukankan      html  css  js  c++  java
  • Mybatis基础核心类说明

    1:  org.apache.ibatis.mapping.ParameterMapping

    为Mybatis参数的抽象表示,包括Java类型与数据库类型以及类型处理器属性名字等等!!

    例如:

    其中id真是参数类型为Long,在mybatis中统一使用Object表示!

    2:org.apache.ibatis.mapping.BoundSql 是XML中配置的某一个方法的SQL的抽象表示,而MappedStatement则是整个Mapper.xml的抽象表示!!!!

    该类封装了SQL以及参数信息,其中 parameterObject成员是一个Map数据结构,key/value为参数名字,例如: 

    MappedStatement是整个Mapper.xml的抽象表示: 

    3:org.apache.ibatis.executor.statement.StatementHandler 负责设置SQL中的参数的类 ,在具体子类中完成操作!

     其中org.apache.ibatis.executor.statement.PreparedStatementHandler#parameterize方法负责参数的填充,StatementHandler持有一个ParameterHandler成员,底层实现使用的是org.apache.ibatis.executor.parameter.ParameterHandler工具类完成到Statement参数的填充!!!!

    4:org.apache.ibatis.executor.parameter.ParameterHandler 一个参数Handler设置所有的参数到PreparedStatement中!!!源码说明:

    /**
     * A parameter handler sets the parameters of the {@code PreparedStatement}
     *
     * @author Clinton Begin
     */
    public interface ParameterHandler {
    
      Object getParameterObject();
    
      void setParameters(PreparedStatement ps)
          throws SQLException;
    
    }
    

      

  • 相关阅读:
    灌溉 最小生成树
    queue的应用uva540
    大数相加
    对于jquery实现原理的浅谈
    div+CSS实现页面的布局要点记录
    spring注解注入的学习
    jsp内置对象学习记录
    web应用的乱码解决
    新发现:排序算法时间复杂度只有O(3n),命名为"wgw"排序法
    java编写的Http协议的多线程下载器
  • 原文地址:https://www.cnblogs.com/leodaxin/p/10076280.html
Copyright © 2011-2022 走看看