To say that this kind of problem is generally compared with a thing, say their advantages and disadvantages, hibernate and JDBC comparison chant, you talk about the advantages and disadvantages of JDBC, and then say the pros and cons of Hibernate, and finally the comparison of hibernate better.
Hibernate:
1. Concept: ormapping Object Relationship Mapping
1, the framework of operational database
The underlying is the database that operates through JDBC
2. Manipulate the database in an object-oriented manner
2. The disadvantages of JDBC
1, the code is too cumbersome
2, not object-oriented database operations
3, resource Close code is also very cumbersome, every time you have to open, close
4. Data cache is not done
5, the transplant is relatively poor
Advantages:
because it is the lowest level operation, so the efficiency is higher
3. Hibernate
1, the code is more streamlined
2, is the object-oriented database operation
3, only need to close an object on the session
4, data cache cache level two cache query cache
5. Good transplant performance
Disadvantages:
1. The programmer cannot control the generation of SQL statements
Hibernate has a hql.
2, if an item on the SQL statement optimization requirements are particularly high, not suitable for hibernate
3, if the data volume of a table is particularly large, not suitable for hibernate
For query database SQL optimization problem, here is a face question, give you a student student table, ask you in various ways to find out the specific student information
Here are five ways to get information about the 2,3,4 of a given student
--mode One select *from studentwhere ID in (2,3,4)--mode two select *from studentwhere ID =2 or id=3 or id=4--mode three select *from Studentwh Ere ID between 2 and 4--mode four select *from studentwhere id>=2 and id<=4--way five select *from studentwhere id=2unionselect * From Studentwhere id=3unionselect *from studentwhere id=4
Interview questions: Talk about your understanding of hibernate