The pros and cons of Java hibernate

Source: Internet
Author: User

  Hibernate has a high degree of encapsulation of JDBC and does not require writing SQL (structured query Language) statements, as long as you use the HQL (Hibernate Query Language) language. The development process for hibernate models is shown in:

  

  

Compared to traditional JDBC, Hibernate has the following advantages:

the mapping is implemented through the configuration of XML or annotations, There is no need to manage database connections.

In a session, just manipulate the session object. You only need to close the session when releasing resources.

......

  

Hibernate's flaws are as follows:

Full table mapping, hql poor performance, unable to optimize SQL statements.

Stored procedures cannot be effectively supported.

  

Therefore, it is recommended to use the semi-automatic mapping framework MyBatis. It is called semi-automatic because it needs to provide Pojo, SQL, and mapping relationships manually. The full table-mapped hibernate only needs to provide pojo and mapping relationships.

Resources

The principle and actual combat of MyBatis technology

The pros and cons of Java hibernate

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.