To say that this kind of problem is usually compared with one thing. To talk about their strengths and weaknesses, hibernate is more of a comparison with JDBC. You talk about the pros and cons of JDBC. Then talk about the advantages and disadvantages of hibernate, and finally a better comparison of hibernate.
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. Poor transplant ratio
Strengths:
because it is the lowest level of operation. So the efficiency is relatively high
3. Hibernate
1, the code is more streamlined
2, is the object-oriented database operation
3, only need to close an object to be able to the session
4, data cache cache level two cache query cache
5. Better transplant
Disadvantages:
1, the program Ape can not control the generation of SQL statements
Hibernate has a hql.
2, it is assumed that a project to optimize the SQL statement requirements are particularly high. Not suitable for hibernate
3. Suppose that the amount of data in a single table is particularly large. Not suitable for hibernate
SQL optimization issues for querying the database. Here is a face question, give you a student student table, ask you to use 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