Hibernate Online Quiz


Advertisements

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

Answer : A

Explaination

Hibernate is an Object-Relational Mapping(ORM) solution for JAVA.

Answer : D

Explaination

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.

A - true

B - false

Answer : B

Explaination

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?

A - property

B - hibernate-config

C - class

D - class-config

Answer : C

Explaination

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?

A - <set>

B - <list>

C - <bag>

D - <map>

Answer : C

Explaination

java.util.Collection property is mapped with a <bag> or <ibag> element and initialized with java.util.ArrayList.

Answer : A

Explaination

Lazy loading is a technique in which objects are loaded on demand basis.

Answer : A

Explaination

HQL stands for Hibernate Query Language.

Answer : C

Explaination

Read-only concurrency strategy is suitable for data which never changes. Use it for reference data only.

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 - name attribute of @Column annotation permits the name of the column to be explicitly specified.

A - true

B - false

Answer : A

Explaination

name attribute of @Column annotation permits the name of the column to be explicitly specified.

hibernate_questions_answers.htm
Advertisements