- 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 true about JDBC?
A - JDBC stands for Java Database Connectivity.
B - JDBC provides a set of Java API for accessing the relational databases from Java program.
Answer : D
Explaination
JDBC stands for Java Database Connectivity and provides a set of Java API for accessing the relational databases from Java program. These Java APIs enables Java programs to execute SQL statements and interact with any SQL compliant database.
Answer : A
Explaination
Yes, SessionFactory is a thread-safe and can be accessed by multiple threads simultaneously.
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 of the following is true about <id> element?
A - The <id> element maps the unique ID attribute in class to the primary key of the database table.
B - The name attribute of the id element refers to the property in the class.
C - The column attribute of the id element refers to the column in the database table.
Answer : D
Explaination
The <id> element maps the unique ID attribute in class to the primary key of the database table. The name attribute of the id element refers to the property in the class and the column attribute refers to the column in the database table. The type attribute holds the hibernate mapping type, this mapping types will convert from Java to SQL data type.
Q 5 - Which of the following is true about <property> element?
A - The <property> element is used to map a Java class property to a column in the database table.
B - The name attribute of the element refers to the property in the class.
C - The column attribute of the element refers to the column in the database table.
Answer : D
Explaination
The <property> element is used to map a Java class property to a column in the database table. The name attribute of the element refers to the property in the class and the column attribute refers to the column in the database table. The type attribute holds the hibernate mapping type, this mapping types will convert from Java to SQL data type.
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 is second level cache in hibernate?
Answer : A
Explaination
The second-level cache is the SessionFactory based cache and is mainly responsible for caching objects across sessions.
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 : 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 Query Language (HQL) is an object-oriented query language.
Answer : C
Explaination
Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties.
To Continue Learning Please Login
Login with Google