- 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 is not an ORM framework?
Answer : D
Explaination
NoSQL is not an ORM framework.
Q 2 - Which of the following is not a core component of Hibernate?
Answer : B
Explaination
Provider is not a core component of Hibernate.
Q 3 - Which of the following is true about detached state of a persistent entity?
A - Once we close the Hibernate Session, the persistent instance will become a detached instance.
B - A new instance of a persistent class which is not associated with a Session.
C - You can make a transient instance detached by associating it with a Session.
Answer : A
Explaination
Once we close the Hibernate Session, the persistent instance will become a detached instance.
Q 4 - Which method is used to save or update the state of the given instance from the underlying database?
Answer : A
Explaination
Session.saveOrUpdate either saves(Object) or updates(Object) the given instance.
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.
Answer : A
Explaination
Since Hibernate 3, lazy loading is by default, enabled so that child objects are not loaded when parent is loaded.
Answer : A
Explaination
The first-level cache is the Session cache and is a mandatory cache through which all requests must pass.
Q 8 - When a Nonstrict-read-write concurrency strategy is to be used?
Answer : C
Explaination
Nonstrict-read-write strategy makes no guarantee of consistency between the cache and the database. Use this strategy if data hardly ever changes and a small likelihood of stale data is not of critical concern.
Q 9 - Which of the following is true about @Id annotation?
A - Hibernate detects that the @Id annotation is on a field.
Answer : C
Explaination
Hibernate detects that the @Id annotation is on a field and assumes that it should access properties on an object directly through fields at runtime.
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.
To Continue Learning Please Login
Login with Google