- 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 is true about Hibernate?
Answer : D
Explaination
All of the above options are true about Hibernate.
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 update the state of the given instance from the underlying database?
Answer : C
Explaination
Session.update updates the state of the given instance from the underlying database.
Q 5 - Which element of hbm.xml automatically generate the primary key values?
Answer : B
Explaination
The <generator> element within the id element is used to automatically generate the primary key values.
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 Query level cache in hibernate?
Answer : A
Explaination
Hibernate implements a cache for query resultsets that integrates closely with the second-level cache.
Q 8 - Which of the following is true about hibernate?
A - Hibernate does not require an application server to operate.
B - Hibernate manipulates Complex associations of objects of your database.
C - Hibernate minimize database access with smart fetching strategies.
Answer : D
Explaination
All of the above are true with respect to 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