2-MyBatis MyBatis learning Introduction

Mybatis is a semi-automatic mapping framework, because it requires manual match offers POJO \ SQL and mapping relationships, and Hibernate mapping of the whole table only need to provide a POJO and mapping relationships.

Persistence framework iBatis (internet abatis) include SQL Maps and DAO, it is a good solution to the problem encountered by Hibernate, the Hibernate different is that it does not just want us to provide a mapping file, you also need to provide SQL statements ,,

MyBatis mapping file needs to be supplied consists of three parts

1 SQL

2 mapping rules

3 POJO

In this way, MyBatis can be configured dynamic SQL, you can optimize SQL, SQL configuration determines mapping rules, support for stored procedures, MyBatis can do almost everything JDBVC can do, and sentences automatic mapping function (if SQL column names and attributes POJO were consistent, MyBatis will automatically provide the mapping rules).

 

 

SQL and XML mapping rules are carried out inside a separate, free to write SQL t, define mapping rules, MYBatis provides the interface becomes mapped only needs one interface and mapping file to run

Guess you like

Origin www.cnblogs.com/alloevil/p/10973815.html