Interview questions: Talk about your understanding of hibernate

Source: Internet
Author: User

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

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.