Hibernate MCQs with answers Page - 2

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 query language is used in Hibernate?

  • (A) SQL
  • (B) HQL
  • (C) PL/SQL
  • (D) JPQL only

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation marks a class as a Hibernate entity?

  • (A) @Table
  • (B) @Entity
  • (C) @Column
  • (D) @Bean

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation specifies the primary key?

  • (A) @Column
  • (B) @Id
  • (C) @Primary
  • (D) @Key

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to generate primary key automatically?

  • (A) @Auto
  • (B) @GeneratedValue
  • (C) @Identity
  • (D) @PrimaryValue

S

Satya • 3.38K Points
Extraordinary

Q. Which caching level is default in Hibernate?

  • (A) Second-level cache
  • (B) Third-level cache
  • (C) First-level cache
  • (D) No cache

S

Satya • 3.38K Points
Extraordinary

Q. Which method begins a transaction?

  • (A) startTransaction()
  • (B) beginTransaction()
  • (C) openTransaction()
  • (D) createTransaction()

S

Satya • 3.38K Points
Extraordinary

Q. Which method commits a transaction?

  • (A) save()
  • (B) commit()
  • (C) apply()
  • (D) push()

S

Satya • 3.38K Points
Extraordinary

Q. Which method rolls back a transaction?

  • (A) undo()
  • (B) rollback()
  • (C) cancel()
  • (D) reverse()

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation maps a class to a table name?

  • (A) @Column
  • (B) @Table
  • (C) @JoinColumn
  • (D) @Map

S

Satya • 3.38K Points
Extraordinary

Q. Which framework commonly integrates Hibernate with Spring?

  • (A) Spring ORM / Spring Data JPA
  • (B) Struts
  • (C) JSF
  • (D) JSP only

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