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

Q 2 - Is Session a thread-safe object?

A - true

B - false

Answer : B

Explaination

No, Session is not thread-safe.

Q 3 - Session.createSQLQuery creates a new instance of Query for the given SQL query string.

A - true

B - false

Answer : A

Explaination

Session.createSQLQuery creates a new instance of Query for the given SQL query string.

Q 4 - Which method is used to update the state of the given instance from the underlying database?

A - Session.store()

B - Session.keep()

C - Session.update()

D - Session.load()

Answer : C

Explaination

Session.update updates the state of the given instance from the underlying database.

Q 5 - Which of the following element maps java.util.Map property in hibernate?

A - <set>

B - <list>

C - <bag>

D - <map>

Answer : D

Explaination

java.util.Map property is mapped with a <map> element and initialized with java.util.HashMap.

Answer : A

Explaination

An employee can have multiple certificates and same certificate can be conferred to many employees. Such situation represents many-to-many association.

Answer : A

Explaination

Hibernate implements a cache for query resultsets that integrates closely with the second-level cache.

Q 8 - Which of the following is a concurrency strategies in hibernate?

A - Transactional

B - Read-write

C - Nonstrict-read-write.

D - All of the above.

Answer : D

Explaination

All of the above are concurrency strategies in hibernate.

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 - length attribute of @Column annotation permits the size of the column used to map a value particularly for a String value.

A - false

B - true

Answer : B

Explaination

length attribute of @Column annotation permits the size of the column used to map a value particularly for a String value.


hibernate_questions_answers.htm

Advertisements
E-Books Store