Current location - Loan Platform Complete Network - Big data management - What is the difference between MyBatis and Hibernate?
What is the difference between MyBatis and Hibernate?
A: Hibernate and Mybatis are orm object-relational mapping framework, are used to persist data framework technology. \x0d\ Hiberante deeper encapsulation of the jdbc, the ability to developers to write sql is not so high, we just need to manipulate the object through the hql statement can be completed on the data persistence operations. \x0d\ In addition hibernate portability is good, such as a project to start using the mysql database, but with the development of the business, now mysql database has been unable to meet the current embroidery ball, and now decided to use the Oracle database, although the sql standard definition of the database between the gap between the sql statement is not large, but different databases sql standard or There is a gap, then we manually modify it will be very difficult to use hibernate only need to change the database dialect can be done. With the hibernate framework, database migration has become very convenient. \x0d\ But hibernate also exists a number of shortcomings, such as in the actual development process will generate a lot of unnecessary sql statements consume program resources, optimization is not very convenient, and the stored procedure support is not too strong enough. But for hibernate it also provides some optimization strategies, such as lazy loading, caching, policy patterns, etc. are optimized for it. \x0d\ Mybatis is also a package of jdbc, but the package is not as deep as hibernate, we can then write sql statements in the configuration file, you can customize the sql statements according to the needs of the data optimization than hibernate is much easier. \x0d\ Mybatis requires programmers to write sql ability to use hibernate developers to be relatively high, and portability is not very good. \x0d\ Involving big data system to use Mybatis is better, because the optimization is more convenient. The amount of data involved is not very large and the optimization is not so high, you can use hibernate