🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: JPA and Hibernate: all 10 questions

Quiz: JPA and Hibernate · Question 5 of 10

Which annotation marks the primary key field?

Which annotation marks the primary key field?

  1. A.@Key
  2. B.@Primary
  3. C.@Id
  4. D.@Column(primary = true)
Answer & explanation

Correct answer: @Id

@Primary is a Spring bean annotation, not JPA.

Can you get the rest right without peeking?

Take the timed Quiz: JPA and Hibernate quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →