I. Overview of Queries
1, get/load primary key query
2. Object Navigation Query
3. HQL query, Hibernate query Language hibernate provides the object-oriented querying language.
4, criteria query, fully object-oriented query (query by Criteria, QBC)
5, sqlquery, local SQL query
1) Cons: Cannot cross database platform: If the database, SQL statements may have to change.
2) Usage scenarios: For situations where complex SQL,HQL cannot be implemented, you can use local SQL queries.
Ii. preparatory work for the presentation
1. JavaBeans and corresponding mapping files
1) Dept
2) Employee
2, Hibernate.cfg.xml
3. Database table structure:
Third, Get/load primary key query
Four, object navigation query
Five, HQL query
1. Precautions:
2, the query column of three types:
3. Condition Inquiry 1:
4. Condition Inquiry 2:
5, aggregate function statistics:
6, group query:
Breakpoint Debugging: