- 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 true about configuration component of Hibernate?
A - The Configuration object is the first Hibernate object you create in any Hibernate application.
B - The Configuration object is usually created only once during application initialization.
Answer : D
Explaination
The Configuration object is the first Hibernate object you create in any Hibernate application and usually created only once during application initialization. It represents a configuration or properties file required by the Hibernate.
Q 3 - Session.createQuery creates a new instance of Query for the given HQL query string.
Answer : A
Explaination
Session.createQuery creates a new instance of Query for the given HQL query string.
Q 4 - Which method is used to re-read the state of the given instance from the underlying database?
Answer : A
Explaination
Session.refresh re-reads the state of the given instance from the underlying database.
Q 5 - Which of the following element maps java.util.SortedMap property in hibernate?
Answer : D
Explaination
This is mapped with a <map> element and initialized with java.util.TreeMap. The sort attribute can be set to either a comparator or natural ordering.
Answer : A
Explaination
Since Hibernate 3, lazy loading is by default, enabled so that child objects are not loaded when parent is loaded.
Q 7 - What HQL stands for?
Answer : A
Explaination
HQL stands for Hibernate Query Language.
Q 8 - Which of the following is true about query level cache in hibernate?
A - Query level cache is an optional feature.
C - Query level cache is only useful for queries that are run frequently with the same parameters.
Answer : D
Explaination
Query level cache is an optional feature and requires two additional physical cache regions that hold the cached query results and the timestamps when a table was last updated. This is only useful for queries that are run frequently with the same parameters.
Q 9 - Which of the following is true about @Entity annotation?
Answer : C
Explaination
@Entity annotation marks a class as an entity bean, so it must have a no-argument constructor that is visible with at least protected scope.
Q 10 - length attribute of @Column annotation permits the size of the column used to map a value particularly for a String value.
Answer : B
Explaination
length attribute of @Column annotation permits the size of the column used to map a value particularly for a String value.
To Continue Learning Please Login
Login with Google