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.