Persistence class
Implementing the corresponding serialization interface
Must have a default constructor
The properties of a persisted class cannot use the keyword
Identifiers
mapping files
Type
Java type and Hibernate type
Generator for primary key
Increment identity assigned UUID
ID prototype
Set
Cascade the relationship between objects and objects
The relationship between the inverse object and the foreign key
Configuration file
Link information for the database
Information that holds the mapping file
Additional information: Hibernate internal features information
<property name= "Show_sql" >true</property>
2. Hibernate process
Configuraction
The configuration file is loaded
Sessionfactory
Configuration file information, mapping file information, persisted class information
Session
1, CRUD operations are completed by the session
2, the transaction is opened by the session
3. Two different sessions can only be used in their own business
4, the session determines the state of the object
5, create a session, equivalent to open a database link
Transaction
1, the transaction is not automatically committed by default
2. Must be opened by the session
3, must be bound with the current session (two sessions cannot share a transaction)
3, the transformation of the state of the object
4, the principle of hibernate:
According to the client's code, reference the mapping file, generate SQL statements, using JDBC Technology for database operation