Introduction to hibernate session

A hibernate execution process


 
 
Two session understanding
1. It is not recommended to use the connection of jdbc to operate the database directly, but to operate the database by using the session.
2. The session can be understood as the object of operating the database.
3. There is a many-to-one relationship between session and connection. Each session has a corresponding connection. A connection can be used by multiple sessions at different times.

 

4. To save the object in the relational database, various methods of the session need to be called, such as save(), update(), delete(), createQuery() and so on.

Guess you like

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