Home » Java » What is the function of Hibernate?

What is the function of Hibernate?

What is the function of Hibernate?

@ sunRainAmazing


First, what is the role of hibernate in the SSH framework?
1, hibernate is a persistence framework for the ORM (object mapping) framework,
It is a lightweight package for JDBC,
Allows programmers to object-oriented thinking of the database operations
2, support a variety of relational databases, and its cascading functions support the relationship between tables and tables
3, after integration with spring, the code to connect to the database and the code to control things are unified,
Managed by spring, it simplifies code and manages things better
4, hibernate offers first - and two - level caching capabilities that greatly improve performance
  
5, hibernate provides convenient API for CURD, reducing the preparation of a large number of SQL statements

Two, the important attributes and significance of cascading relations
1, inverse (which end of the relationship is maintained)?
At this point, the inverse value is used to indicate who will maintain the Association
When true is set, the inversion control role maintains the association relationship with the object associated with the property
  
2, Casecade (cascading, deleting, storing, updating, all)
All: all operations are passed to associated objects
Save-update saves and updates the objects passed to the associated object
Delete delete operations are passed to associated objects
Delete-orphan: all operations are passed to associated objects and deleted objects that are no longer associated with the parent object
  
3, lazy lazy loading (must keep session valid, otherwise cannot obtain, defaults to true delay load)
The lazy=false indicates that the record of all associated tables is loaded when it is started
The lazy=true indicates that only the associated method is loaded

Latest