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 : 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.

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 of the following is the root node of hbm.xml file?

A - hibernate-mapping

B - hibernate-config

C - class-mapping

D - class-config

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.SortedMap property in hibernate?

A - <set>

B - <list>

C - <bag>

D - <map>

Answer : D

Explaination

This is mapped with a <map> element and initialized with java.util.TreeMap. The sort attribute can be set to either a comparator or natural ordering.

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.

Q 8 - Which of the following database is supported by Hibernate?

A - DB2/NT

B - PostgreSQL

C - Sybase SQL Server

D - All of the above

Answer : D

Explaination

All of the above mentioned databases are supported by Hibernate.

Q 9 - You would need one SessionFactory object per database using a separate configuration file.

A - false

B - true

Answer : B

Explaination

You would need one SessionFactory object per database using a separate configuration file.

Answer : C

Explaination

Hibernate supports named parameters in its HQL queries. HQL supports a range of aggregate methods, similar to SQL.


hibernate_questions_answers.htm

Advertisements