- 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 JDBC stands for?
Answer : B
Explaination
JDBC stands for Java Database Connectivity and provides a set of Java API for accessing the relational databases from Java program.
Q 2 - Which of the following is true about SessionFactory object in hibernate?
B - SessionFactory object allows for a Session object to be instantiated.
Answer : D
Explaination
SessionFactory object configures Hibernate for the application using the supplied configuration file and allows for a Session object to be instantiated. The SessionFactory is a thread safe object and used by all the threads of an application.
Q 3 - Which of the following is true about transient state of a persistent entity?
A - A new instance of a persistent class which is not associated with a Session.
B - A new instance of a persistent class which has no representation in the database.
C - A new instance of a persistent class which has no identifier value.
Answer : D
Explaination
A new instance of a a persistent class which is not associated with a Session and has no representation in the database and no identifier value is considered transient by Hibernate.
Q 4 - Which element of hbm.xml defines maps the unique ID attribute in class to the primary key of the database table?
Answer : A
Explaination
The <id> element maps the unique ID attribute in class to the primary key of the database table.
Q 5 - Which of the following element maps java.util.Collection property in hibernate?
Answer : C
Explaination
java.util.Collection property is mapped with a <bag> or <ibag> element and initialized with java.util.ArrayList.
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 HQL stands for?
Answer : A
Explaination
HQL stands for Hibernate Query Language.
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.
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 INSERT CLAUSE in HQL?
B - HQL supports INSERT INTO clause without any restriction.
Answer : A
Explaination
HQL supports INSERT INTO clause only where records can be inserted from one object to another object.
To Continue Learning Please Login
Login with Google