- 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.
Q 1 - Which of the following tools/frameworks provides integration with Hibernate?
Answer : D
Explaination
All of the above provide integration with Hibernate.
Q 2 - Which of the following object is used to create SessionFactory object in hibernate?
Answer : A
Explaination
Configuration object is used to create a SessionFactory object.
Q 3 - Session.beginTransaction method begins a unit of work and returns the associated Transaction object.
Answer : A
Explaination
Session.beginTransaction method begins a unit of work and returns the associated Transaction object.
Q 4 - Which of the following elements is used to define specific mappings from a Java classes to the database tables?
Answer : C
Explaination
The <class> elements are used to define specific mappings from a Java classes to the database tables. The Java class name is specified using the name attribute of the class element and the database table name is specified using the table attribute.
Q 5 - Which of the following element maps java.util.Set property in hibernate?
Answer : A
Explaination
java.util.Set property is mapped with a <set> element and initialized with java.util.HashSet.
Q 6 - Which of the following element is used to represent one-to-many relationship in hibernate?
Answer : A
Explaination
<one-to-many> element is used to define one-to-many association.
Q 7 - Whis of the following is true about first level cache in hibernate?
A - The first-level cache is the Session cache.
B - The first-level cache is a mandatory cache through which all requests must pass.
C - The Session object keeps an object under its own power before committing it to the database.
Answer : D
Explaination
The first-level cache is the Session cache and is a mandatory cache through which all requests must pass. The Session object keeps an object under its own power before committing it to the database.
Q 8 - Which of the following database is not supported by Hibernate?
Answer : C
Explaination
FoundationDB is a NoSQL database and is not supported by Hibernate.
Answer : A
Explaination
A Session is used to get a physical connection with a database.
Q 10 - Which of the following is true about @Table annotation?
Answer : C
Explaination
The @Table annotation allows you to specify the details of the table that will be used to persist the entity in the database. The @Table annotation provides four attributes, allowing you to override the name of the table, its catalogue, and its schema, and enforce unique constraints on columns in the table.