- 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 database is not supported by Hibernate?
Answer : C
Explaination
FoundationDB is a NoSQL database and is not supported by Hibernate.
Q 2 - Which of the following is true about Session object in hibernate?
A - A Session is used to get a physical connection with a database.
B - The Session object is lightweight.
C - Persistent objects are saved and retrieved through a Session object.
Answer : D
Explaination
A Session is used to get a physical connection with a database. The Session object is lightweight and designed to be instantiated each time an interaction is needed with the database. Persistent objects are saved and retrieved through a Session object.
Q 3 - Which method is used to remove a persistent instance from the datastore?
Answer : A
Explaination
Session.delete() removes a persistent instance from the datastore.
Q 4 - Which of the following is the root node of hbm.xml file?
Answer : A
Explaination
The mapping document is an XML document having <b><hibernate-mapping></b> as the root element which contains all the <class> elements.
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 situation represents many-to-many relationship?
B - An employee can have multiple certificates.
Answer : A
Explaination
An employee can have multiple certificates and same certificate can be conferred to many employees. Such situation represents many-to-many association.
Q 7 - What HQL stands for?
Answer : A
Explaination
HQL stands for Hibernate Query Language.
Q 8 - When a Read-write concurrency strategy is to be used?
Answer : B
Explaination
Use Read-write strategy for read-mostly data where it is critical to prevent stale data in concurrent transactions.
Answer : B
Explaination
The SessionFactory is heavyweight object so usually it is created during application start up and kept for later use.
Q 10 - name attribute of @Column annotation permits the name of the column to be explicitly specified.
Answer : A
Explaination
name attribute of @Column annotation permits the name of the column to be explicitly specified.
To Continue Learning Please Login
Login with Google