![Hibernate Tutorial](/hibernate/images/hibernate-mini-logo.jpg)
- 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.
![Questions and Answers](/images/questions_and_answers.png)
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 Query object in hibernate?
B - Query objects SQL string to retrieve data from the database and create objects.
Answer : D
Explaination
Query objects use SQL or Hibernate Query Language (HQL) string to retrieve data from the database and create objects. A Query instance is used to bind query parameters, limit the number of results returned by the query, and finally to execute the query.
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 method is used to get a persistent instance from the datastore?
Answer : B
Explaination
Session.get returns the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.
Q 5 - Which element of hbm.xml is used to map a Java class property to a column in the database table?
Answer : C
Explaination
The <property> element is used to map a Java class property to a column in the database table.
Q 6 - What is lazy loading?
A - Lazy loading is a technique in which objects are loaded on demand basis.
B - Lazy loading is a technique in which objects are persisted on demand basis.
Answer : A
Explaination
Lazy loading is a technique in which objects are loaded on demand basis.
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 - When a Read-only concurrency strategy is to be used?
Answer : C
Explaination
Read-only concurrency strategy is suitable for data which never changes. Use it for reference data only.
Answer : A
Explaination
Configuration object is used to create a SessionFactory object.
Q 10 - Which of the following is true about HQL?
A - Hibernate supports named parameters in its HQL queries.
B - HQL supports a range of aggregate methods, similar to SQL.
Answer : C
Explaination
Hibernate supports named parameters in its HQL queries. HQL supports a range of aggregate methods, similar to SQL.
To Continue Learning Please Login