![Hibernate Tutorial](/hibernate/images/hibernate-mini-logo.jpg)
- Hibernate Tutorial
- Hibernate - Home
- ORM - Overview
- Hibernate - Overview
- Hibernate - Architecture
- Hibernate - Environment
- Hibernate - Configuration
- Hibernate - Sessions
- Hibernate - Persistent Class
- Hibernate - Mapping Files
- Hibernate - Mapping Types
- Hibernate - Examples
- Hibernate - O/R Mappings
- Hibernate - Annotations
- Hibernate - Query Language
- Hibernate - Criteria Queries
- Hibernate - Native SQL
- Hibernate - Caching
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate Useful Resources
- Hibernate - Questions and Answers
- Hibernate - Quick Guide
- Hibernate - Useful Resources
- Hibernate - Discussion
Hibernate Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Hibernate Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
![Questions and Answers](/images/questions_and_answers.png)
Q 1 - What ORM stands for?
Answer : B
Explaination
ORM stands for Object-Relational Mapping (ORM) is a programming technique for converting data between relational databases.
Q 2 - Which of the following is true about Query object in hibernate?
B - Query objects SQL string to retrieve data from the database and create objects.
Answer : D
Explaination
Query objects use SQL or Hibernate Query Language (HQL) string to retrieve data from the database and create objects. A Query instance is used to bind query parameters, limit the number of results returned by the query, and finally to execute the query.
Q 3 - Session.createSQLQuery creates a new instance of Query for the given HQL query string.
Answer : B
Explaination
Session.createSQLQuery creates a new instance of Query for the given SQL query string.
Q 4 - Which of the following is the root node of hbm.xml file?
Answer : A
Explaination
The mapping document is an XML document having <b><hibernate-mapping></b> as the root element which contains all the <class> elements.
Q 5 - Which of the following element maps java.util.List property in hibernate?
Answer : B
Explaination
java.util.List property is mapped with a <list> element and initialized with java.util.ArrayList.
Q 6 - Which of the following element is used to represent one-to-one relationship in hibernate?
Answer : A
Explaination
<many-to-one> element is used to define one-to-one association.
Q 7 - What HQL stands for?
Answer : A
Explaination
HQL stands for Hibernate Query Language.
Q 8 - When a Transactional concurrency strategy is to be used?
Answer : B
Explaination
Use Transactional strategy for read-mostly data where it is critical to prevent stale data in concurrent transactions.
Answer : A
Explaination
Configuration object is used to create a SessionFactory object.
Q 10 - Which of the following is true about HQL?
B - The AS clause can be used to assign aliases to the classes in HQL queries.
Answer : C
Explaination
HQL queries are translated by Hibernate into conventional SQL queries which in turns perform action on database. The AS clause can be used to assign aliases to the classes in your HQL queries.