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

Explaination

ORM stands for Object-Relational Mapping (ORM) is a programming technique for converting data between relational databases.

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

Explaination

Once we close the Hibernate Session, the persistent instance will become a detached instance.

Answer : D

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.

Answer : D

Explaination

The <property> element is used to map a Java class property to a column in the database table. The name attribute of the element refers to the property in the class and the column attribute refers to the column in the database table. The type attribute holds the hibernate mapping type, this mapping types will convert from Java to SQL data type.

Q 6 - Child objects are not loaded when parent is loaded/populated from database. What this technique is called?

A - Eager Loading

B - Lazy Loading

C - Request based Loading

D - None of the above.

Answer : B

Explaination

In lazy loading child objects are not loaded when parent is loaded.

Q 7 - Is second level caching mandatory in hibernate?

A - true

B - false

Answer : B

Explaination

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.

Answer : D

Explaination

All of the above are true with respect to ORM vs JDBC.

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.

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