Git Product home page Git Product logo

simple-mybatis's Introduction

简单的Mybatis

这是根据mybatis运行原理实现到一个简易型mybatis框架

  • 已实现传统使用方式
    • 传统dao开发存在的问题
      • (1)存在加载配置文件,创建会话的代码重复
      • (2)存在调用mapperStatement存在硬编码问题
  • 已实现mapper动态代理使用方式
  • 暂未实现事务手动提交(PS: 默认执行一次mapper会自动提交)
    • PS: 因为在实际场景下,多数据源的切换和数据源事务的管理均反转到Spring进行管理

原声JDBC的问题

  • 数据库配置信息存在硬编码问题
  • 频繁创建和释放数据库链接
  • sql语句,设置参数,获取结果集均存在硬编码问题
  • 手动封装结果集较为繁琐

简单mybatis的解决思路

  • 将数据库配置信息存储到xml文件中
  • 使用数据库链接池管理数据库链接
  • 将sql存储到xml中,使用反射设置参数
  • 使用反射封装结果集

simple-mybatis's People

Contributors

jimisun123 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.