Hibernate advantages and disadvantages

Advantages of Hibernate
(1) Object/Relational Database Mapping (ORM)
It only needs to manipulate objects when using it, making development more object-oriented, abandoning the idea of ​​database center, and complete object-oriented thinking

(2) Transparent persistence (persistent)
with Persistent state, single-threaded object with business functions, this object has a short lifespan. These objects may be ordinary JavaBeans/POJOs that do not implement third-party frameworks or interfaces, the only special thing is that they are associated with (only one) Session. Once the Session is closed, these objects are taken out of the persistent state so that they can be used freely by any layer of the application. (For example, used as a data transfer object dealing with the presentation layer.)
           
(3) Transaction Transaction (org.hibernate.Transaction)
An object used by the application to specify the scope of the atomic operation unit, it is single-threaded and has a short life cycle. It abstracts the application from the underlying concrete JDBC, JTA and CORBA transactions. In some cases, a Session may contain multiple Transaction objects. Although the use of this object is optional, whether using the underlying API or using the Transaction object, the opening and closing of transaction boundaries is essential.
(4) It is not intrusive, the so-called lightweight framework
(5) Portability will be very good
(6) Cache mechanism, providing first-level cache and second
-level cache (7) Concise HQL programming

2. Hibernate disadvantages
(1) ) Hibernate is weak in batch data processing
(2) Simple addition, deletion and modification of a single object is suitable for Hibernate, but for batch modification and deletion, it is not suitable for Hibernate, which is also the weakness of the OR framework; when using the specific optimization mechanism of the database, it is not suitable to use Hibernate

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326636394&siteId=291194637