The difference between hibernate and mybatis: JAVA face questions 3

Similarities:
1) belong to the frame ORM

2) are packaged on the jdbc

3) belong to the frame persistence layer

Different points:
. 1) Hibernate is object-oriented, mybatis sql is oriented;

2) hibernate automatic orm, mybatis is semiautomatic ORM;

3) hibernate entity mapping query object must be a full field of inquiry, mybatis can not;

4) hibernate cascade operation, mybatis no;

. 5) prepared hql hibernate database queries is greatly reduced and the coupling of the object database, MyBatis dynamic sql, sql need handwriting, and the degree of coupling between the database depends on the method written sql programmer, so portability to hibernate much larger than mybatis.

6) hibernate dialects have exaggerated database, mybatis depending on the particular database.

7) hibernate have a complete log system, mybatis is relatively lacking.

As an example to describe the next:

hibernate is like an intelligent robot that can bring great convenience to users, but it is costly to develop this robot needs (including learning and proficiency); mybatis is like a machine tool, use it is very simple, but how you use depends on the user.

 

Guess you like

Origin blog.csdn.net/qq_25594727/article/details/91949084