- 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 - 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 object is used to create SessionFactory object in hibernate?
Answer : A
Explaination
Configuration object is used to create a SessionFactory object.
Q 3 - Which of the following is true about hibernate.dialect property in hibernate configuration?
A - This property makes Hibernate generate the appropriate SQL for the chosen database.
B - This property makes Hibernate generate the appropriate java code for the chosen database.
Answer : A
Explaination
This property makes Hibernate generate the appropriate SQL for the chosen database.
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 element of hbm.xml is used to map a Java class property to a column in the database table?
Answer : C
Explaination
The <property> element is used to map a Java class property to a column in the database table.
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 - What is first level cache in hibernate?
A - The first-level cache is the Session based cache.
B - The first-level cache is the SessionFactory based cache.
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 Read-only concurrency strategy is to be used?
Answer : C
Explaination
Read-only concurrency strategy is suitable for data which never changes. Use it for reference data only.
Answer : B
Explaination
The SessionFactory is heavyweight object so usually it is created during application start up and kept for later use.
Q 10 - Which of the following is true about HQL?
A - Hibernate supports named parameters in its HQL queries.
B - HQL supports a range of aggregate methods, similar to SQL.
Answer : C
Explaination
Hibernate supports named parameters in its HQL queries. HQL supports a range of aggregate methods, similar to SQL.
To Continue Learning Please Login
Login with Google