Comparing JPA with Hibernate and Mymatis

Time:2019-7-20

1. JPA, Hibernate, Mybatis

  1.JPA:It is an ORM specification, not an ORM framework. It is implemented by the major ORM frameworks.

  2.Hibernate:At present, the most popular ORM framework is smart in design and rich in documents (fully automatic operation).It’s just that the performance is not well controlled.

    Hibernate is a complete ORM framework, conventional CRUD we do not need to write an SQL;

  3.MyBatis:This is an open source project of apache, iBatis, which provides persistence framework including SQL Maps and Dao, allowing developers to write SQL directly (more flexible). (Sql operation)

    MyBatis is not a complete ORM framework, because we also need to write all the SQL ourselves.

 

2. Differences between JPA and Hibernate and Mymatis

  JPA:Specification. The major ORM frameworks implement this specification. The table can be built automatically.

  Hibernate:It is a complete ORM, which does not require us to write sql. The framework is heavy, the learning cost is high, the performance is not well controlled, the function is powerful and the document is rich.

  Mybatis:Not a complete ORM, programmers need to write all the SQL, lightweight framework, low learning cost, good performance control. The table cannot be built automatically.

 

How ORM operates on database relational mapping:

1. Mapping domain and tables in database, mapping variables of domain members and columns in tables through configuration files.

Recommended Today

Understanding and deepening of relative path and absolute path

What is relative path and absolute path Last week’s report solved some problems, but also exposed many problems, one of which is the relative path and absolute path. For PHP using xampp to build a server, the relative path refers to the current file relative to the user’s access, and the absolute path refers to […]