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 configuration component of Hibernate?
The Configuration object is the first Hibernate object you create in any Hibernate application and usually created only once during application initialization. It represents a configuration or properties file required by the Hibernate.
Q 3 - Session.createSQLQuery creates a new instance of Query for the given HQL query string.
Session.createSQLQuery creates a new instance of Query for the given SQL query string.
Q 4 - Which of the following elements is used to define specific mappings from a Java classes to the database tables?
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.Collection property in hibernate?
java.util.Collection property is mapped with a <bag> or <ibag> element and initialized with java.util.ArrayList.
Q 6 - What is lazy loading?
Lazy loading is a technique in which objects are loaded on demand basis.
Q 7 - What HQL stands for?
HQL stands for Hibernate Query Language.
Q 8 - When a Read-only concurrency strategy is to be used?
Read-only concurrency strategy is suitable for data which never changes. Use it for reference data only.
Q 9 - Which of the following is true about @Id annotation?
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 - name attribute of @Column annotation permits the name of the column to be explicitly specified.
name attribute of @Column annotation permits the name of the column to be explicitly specified.