- 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 not an ORM framework?
Answer : D
Explaination
NoSQL is not an ORM framework.
Answer : A
Explaination
Yes, SessionFactory is a thread-safe and can be accessed by multiple threads simultaneously.
Q 3 - Which of the following is true about transient state of a persistent entity?
A - A new instance of a persistent class which is not associated with a Session.
B - A new instance of a persistent class which has no representation in the database.
C - A new instance of a persistent class which has no identifier value.
Answer : D
Explaination
A new instance of a a persistent class which is not associated with a Session and has no representation in the database and no identifier value is considered transient by Hibernate.
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.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 - 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 - Whis of the following is true about first level cache in hibernate?
A - The first-level cache is the Session cache.
B - The first-level cache is a mandatory cache through which all requests must pass.
C - The Session object keeps an object under its own power before committing it to the database.
Answer : D
Explaination
The first-level cache is the Session cache and is a mandatory cache through which all requests must pass. The Session object keeps an object under its own power before committing it to the database.
Q 8 - Which of the following is a concurrency strategies in hibernate?
Answer : D
Explaination
All of the above are concurrency strategies in hibernate.
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 HQL?
A - Hibernate Query Language (HQL) is an object-oriented query language.
Answer : C
Explaination
Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties.