Comparing JPA with Hibernate and Mymatis


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

Details of multi-path and large capacity hard disk mount under CentOS

I. application environment and requirementsBlade servers connect HP storage through fiber switches, forming a 2×2 link The storage capacity of the operating system for CentOS 6.4 64 bit mount is 2.5t Based on this application environment, two problems need to be solved: In order to ensure the stability and transmission performance of the link, multi-path […]