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?
Hibernate is an Object-Relational Mapping(ORM) solution for JAVA.
Q 2 - Which of the following is true about Session object in hibernate?
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 of the following is true about hibernate.dialect property in hibernate configuration?
This property makes Hibernate generate the appropriate SQL for the chosen database.
Q 4 - Which element of hbm.xml defines maps the unique ID attribute in class to the primary key of the database table?
The <id> element maps the unique ID attribute in class to the primary key of the database table.
Q 5 - Which element of hbm.xml automatically generate the primary key values?
The <generator> element within the id element is used to automatically generate the primary key values.
Q 6 - Which of the following situation represents many-to-many relationship?
An employee can have multiple certificates and same certificate can be conferred to many employees. Such situation represents many-to-many association.
Second level cache is an optional cache and first-level cache will always be consulted before any attempt is made to locate an object in the second-level cache.
Q 8 - Which of the following database is not supported by Hibernate?
FoundationDB is a NoSQL database and is not supported by Hibernate.
Configuration object is used to create a SessionFactory object.
Q 10 - Which of the following is true about @GeneratedValue annotation?
By default, the @Id annotation will automatically determine the most appropriate primary key generation strategy to be used but you can override this by applying the @GeneratedValue annotation which takes two parameters strategy and generator.