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