The advantages and disadvantages of Hibernate

Source: Internet
Author: User

The advantages and disadvantages of Hibernate are briefly described below.

1. hibernate advantages:

(1) object/Relational Database ing (Basic o/R Mapping)

It only needs to manipulate objects to make development more object-oriented. It discards the idea of database center and completely object-oriented.

(2) Persistent)

A single-threaded object with persistence and business functions. This object has a short lifetime. These objects may be common JavaBeans/pojo objects that do not implement third-party frameworks or interfaces. The only special difference is that they are associated with (only one) sessions. Once this session is closed, these objects will be out of the persistent state, so that they can be freely used by any layer of the application. (For example, it is used as a data transmission object dealing with the presentation layer .)

(3) transaction (Org. hibernate. Transaction)

An application is used to specify the range of atomic operation units. It is single-threaded and has a short life cycle. It isolates applications from specific underlying JDBC, JTA, and CORBA transactions through abstraction. In some cases, a session may contain multiple transaction objects. Whether or not to use this object is optional, but whether to use the underlying API or the transaction object, the opening and closing of the transaction boundary is indispensable.

(4) It is not invasive, that is, the so-called Lightweight Framework.

(5) portability will be good.

(6) cache mechanism. Provides Level 1 cache and level 2 cache.

(7) Simple hql programming.

2. disadvantages of hibernate:

(1) Hibernate is weak in batch data processing.

(2) simple query, modification, deletion, and addition of an object (single object). It is not applicable to batch modification or deletion, but for batch modification and deletion, hibernate is not suitable for use, which is also a weakness of the or framework. Hibernate is not suitable for use when a database's specific optimization mechanism is used.

These are the advantages and disadvantages of hibernate that I am familiar.

Related Article

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.