Hibernate MCQs with answers Page - 3

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 open a Hibernate session?

  • (A) getSession()
  • (B) openSession()
  • (C) createSession()
  • (D) startSession()

S

Satya • 3.38K Points
Extraordinary

Q. Which method closes a Hibernate session?

  • (A) end()
  • (B) close()
  • (C) destroy()
  • (D) stop()

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation maps a class property to a table column?

  • (A) @Column
  • (B) @Field
  • (C) @Attribute
  • (D) @Property

S

Satya • 3.38K Points
Extraordinary

Q. Which fetch type loads data immediately?

  • (A) LAZY
  • (B) EAGER
  • (C) MANUAL
  • (D) AUTO

S

Satya • 3.38K Points
Extraordinary

Q. Which fetch type loads data only when accessed?

  • (A) EAGER
  • (B) AUTO
  • (C) LAZY
  • (D) IMMEDIATE

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation defines one-to-many relationship?

  • (A) @OneToOne
  • (B) @OneToMany
  • (C) @ManyToOne
  • (D) @ManyToMany

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation defines many-to-one relationship?

  • (A) @OneToMany
  • (B) @ManyToOne
  • (C) @ManyToMany
  • (D) @OneToOne

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used for many-to-many relationship?

  • (A) @ManyToMany
  • (B) @ManyToOne
  • (C) @OneToOne
  • (D) @Join

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation defines foreign key column?

  • (A) @Column
  • (B) @JoinColumn
  • (C) @ForeignKey
  • (D) @Key

S

Satya • 3.38K Points
Extraordinary

Q. Which interface represents a Hibernate transaction?

  • (A) Session
  • (B) Transaction
  • (C) Query
  • (D) Configuration

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