What is Mybatis?

       What is Mybatis?

              Founder: Clinton let Tony

              (1), mybatis is an excellent java-based persistence framework, which encapsulates the internal jdbc, so developers only need to focus sql statement itself, without the need to spend energy to handle the loading drive, create a connection, create a statement and so complicated process.

              (2), MyBatis persistence framework is to support outstanding ordinary SQL queries, stored procedures and advanced mappings. MyBatis eliminates almost all manual settings and parameters JDBC code and retrieve the result set. MyBatis can use simple XML or Annotations for configuration and map primitives, Map interfaces and Java POJO (Plain Old Java Objects, ordinary Java Objects) to database records in.

              (. 3), xml or annotation by mybatis way, the various configurations statement to be executed together, and the final map generation sql statement executed by a java objects and dynamic parameters in the sql statement, sql and mapping the result of the last executed frame mybatis for the java object and returns.

              (4), by SqlSessionFactoryBuider SqlSessionFactory generated by the XML configuration file, and then generates a SqlSessionFactory SqlSession, and finally to open and execute SQL statements from the transaction SqlSession. Which SqlSessionFactoryBuider, SqlSessionFactory, SqlSession life cycle are similar.

              (5), SQL optimization:

                      1, Mybatis of SQL is written in the manual, so you can specify fields queries on demand.

                      2, MyBatis of SQL is to manually write so easy to adjust. Mybatis itself, without log statistics, use Log4j logging.

                      3, MyBatis can be carried out more detailed SQL optimization can reduce query field.


Published 51 original articles · won praise 11 · views 6094

Guess you like

Origin blog.csdn.net/weixin_42140261/article/details/95207535