A brief introduction to hibernate knowledge

Hibernate is a persistence framework that connects to the data layer and is responsible for dealing with the database to complete the persistence work. It solves a core problem that is ORM, or object-relational data mapping.
The role of Hibernate
-----------------
1. Reduce tedious coding (get database connection, execute SQL, close database connection...)
2. More object-oriented design, current persistence Layer frameworks are mostly based on object-oriented design ideas.
3. Better performance, most of the persistence layer framework provides excellent performance optimization mechanisms, such as built-in database connection pool support
4. Better portability, Java-based cross-platform features, the system can switch between different operating systems , But due to the differences in databases, portability has encountered resistance.

What is a framework:
Provides a set of APIs, and we use APIs to improve development efficiency tools.
Purpose: 1. Improve development efficiency
2. Reduce maintenance cost
3. Standardize code format

Advantages of hibernate
-----------------
1. More object-oriented: To operate the database with object-oriented thinking, we only need to manipulate objects, and development is more object-oriented.
2. Portability: Because Hibernate encapsulates the persistence layer, you don't know the database, and all the code you write is reusable.
3. Hibernate is a non-invasive framework, which is called a lightweight framework.
Comparing Struts Action and ActionForm, both need to be inherited and are inseparable from Struts. Hibernate does not need to inherit any classes and does not need to implement any interfaces. Such objects are called POJO objects.
4. Hibernate code testing is convenient.
5. Improve efficiency

Guess you like

Origin blog.csdn.net/weixin_44703894/article/details/110346751