Session interface:
The session interface session interface is one of the most important interfaces for hibernate developers. In hibernate, however, the instantiated session is a lightweight class, and creating and destroying it does not consume a lot of resources. This is really important in the actual project, because in the client program, the session object may be created and destroyed continuously, if the session overhead is too large, it will adversely affect the system. But the session object is non-thread safe, so in your design it is better to have a thread that creates only one session object. Session can be seen as a middle interface between data connection and transaction management. We can think of the session as a buffer of persistent objects, hibernate detects changes to these persistent objects, and refreshes the database in a timely manner. We sometimes call the session a persistent Layer manager because it contains some persistent layer-related operations, such as storing persistent objects to the database, and getting them from the database. It is important to note that Hibernate's session differs from the HttpSession in JSP applications. When we use the term session, we refer to the session in Hibernate, and we will later call the Httpsesion object the user session.
Sessionfactory interface:
The Sessionfactroy interface is responsible for initializing hibernate. It acts as a proxy for the data storage source and is responsible for creating session objects. The factory model is used here. It is important to note that Sessionfactory is not lightweight, because in general, a project typically requires only one sessionfactory, and when you need to manipulate multiple databases, you can specify a sessionfactory for each database.
Transaction Interface
The transaction interface is responsible for transaction-related operations , generally occurring in the deletion and deletions of Hib ernate, but people using Hibernate generally use spring to manage transactions.
Query interface
Query is responsible for executing various database queries. It can be expressed in either the HQL language or the SQL statement. its return value is generally LiSt. Need to convert yourself.
Configuration Interface:
The configuration object is used to configure and root start hibernate. Hibernate applications use configuration instances to specify the location of the object-relational map file or dynamically configure Hibernate properties, and then create the Sessionfactory instance. We can view the source code of the configuration, and its configure () method is implemented like this:
Hibernate has five core interfaces, namely: Session Transaction Query sessionfactoryconfiguration