- 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 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 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.
Q 6 - Which of the following element is used to represent many-to-many relationship in hibernate?
Answer : A
Explaination
<many-to-many> element is used to define many-to-many association.
Q 7 - What HQL stands for?
Answer : A
Explaination
HQL stands for Hibernate Query Language.
Q 8 - Which of the following is true with respect to ORM vs JDBC?
A - ORM system lets business code access objects rather than DB tables.
B - ORM system hides details of SQL queries from OO logic.
C - ORM system helps in Transaction management and automatic key generation.
Answer : D
Explaination
All of the above are true with respect to ORM vs JDBC.
Q 9 - You would need one SessionFactory object per database using a separate configuration file.
Answer : B
Explaination
You would need one SessionFactory object per database using a separate configuration file.
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