Part of Hibernate

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.