
- 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 - Cascade Types
- Hibernate - Annotations
- Hibernate - Query Language
- Hibernate - Criteria Queries
- Hibernate - Native SQL
- Hibernate - Caching
- Hibernate - Entity Lifecycle
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate - ID Generator
- Hibernate - Saving Image
- Hibernate - log4j Integration
- Hibernate - Spring Integration
- Hibernate - Struts 2 Integration
- Hibernate - Web Application
- Mapping Table Examples
- Hibernate - Table Per Hiearchy
- Hibernate - Table Per Concrete Class
- Hibernate - Table Per Subclass
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 : B
Explaination
No, Session is not thread-safe.
Q 3 - Which of the following is true about persistent state of a persistent entity?
A - You can make a transient instance persistent by associating it with a Session.
B - A persistent instance has a representation in the database.
Answer : D
Explaination
You can make a transient instance persistent by associating it with a Session. A persistent instance has a representation in the database, an identifier value and is associated with a Session.
Q 4 - Which of the following is true about <class> element?
B - The Java class name is specified using the name attribute of the class element.
C - The database table name is specified using the table attribute of the class element.
Answer : D
Explaination
The <class> elements are used to define specific mappings from a Java classes to the database tables. The Java class name is specified using the name attribute of the class element and the database table name is specified using the table attribute.
Q 5 - Which of the following element maps java.util.List property in hibernate?
Answer : B
Explaination
java.util.List property is mapped with a <list> element and initialized with java.util.ArrayList.
Q 6 - Which of the following element is used to represent one-to-one relationship in hibernate?
Answer : A
Explaination
<many-to-one> element is used to define one-to-one association.
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-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 : A
Explaination
Configuration object is used to create a SessionFactory object.
Q 10 - Which of the following is true about HQL?
B - The AS clause can be used to assign aliases to the classes in HQL queries.
Answer : C
Explaination
HQL queries are translated by Hibernate into conventional SQL queries which in turns perform action on database. The AS clause can be used to assign aliases to the classes in your HQL queries.