Mybatis principle and source code analysis

What is Mybatis?

  Mybatis is a semi-automated persistence framework.

Why Mybatis?

  JDBC:

    SQL entrained in Java code block, resulting in high coupling hardcoded

    Not easy to maintain and the actual development needs in SQL change, circumstances change frequently in common

  Hibernate and JPA:

    Long difficult complex SQL, for a Hibernate process is not easy

    Internal automatically generated SQL, not easy to do special optimization

    Automatic mapping based on the whole frame, the number of fields compared POJOs suffering partial map, resulting in decreased performance database

The actual development, for developers, the core still need their own SQL optimization, and Mybatis SQL and Java code in separate, clear boundary function, a focus on business, a focus on data

Guess you like

Origin www.cnblogs.com/yangyongjie/p/11141308.html