Interview questions: Talk about your understanding of hibernate

Source: Internet
Author: User

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

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.