Hibernate MCQs with answers Page - 4

Here, you will find a collection of MCQ questions on Hibernate. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

S

Satya • 3.38K Points
Extraordinary

Q. Which method is used to create HQL query?

  • (A) createHQL()
  • (B) createQuery()
  • (C) query()
  • (D) makeQuery()

S

Satya • 3.38K Points
Extraordinary

Q. Which method returns list of objects from query?

  • (A) getList()
  • (B) list()
  • (C) fetchAll()
  • (D) read()

S

Satya • 3.38K Points
Extraordinary

Q. Which method returns a single object from query?

  • (A) single()
  • (B) uniqueResult()
  • (C) one()
  • (D) object()

S

Satya • 3.38K Points
Extraordinary

Q. Which cache must be configured manually?

  • (A) First-level cache
  • (B) Second-level cache
  • (C) Session cache
  • (D) Local cache

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation enables caching in Hibernate?

  • (A) @Cacheable
  • (B) @Cache
  • (C) @EnableCache
  • (D) @Caching

S

Satya • 3.38K Points
Extraordinary

Q. Which state represents an object associated with session?

  • (A) Transient
  • (B) Persistent
  • (C) Detached
  • (D) Removed

S

Satya • 3.38K Points
Extraordinary

Q. Object not associated with session is?

  • (A) Persistent
  • (B) Detached
  • (C) Transient
  • (D) Stored

S

Satya • 3.38K Points
Extraordinary

Q. Object removed from session but exists in DB is?

  • (A) Transient
  • (B) Detached
  • (C) Persistent
  • (D) Deleted

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used for versioning and optimistic locking?

  • (A) @Lock
  • (B) @Version
  • (C) @Optimistic
  • (D) @Check

S

Satya • 3.38K Points
Extraordinary

Q. Which API replaced Hibernate Criteria API?

  • (A) JPA Criteria API
  • (B) JDBC API
  • (C) Servlet API
  • (D) Spring MVC API

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ