← 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?
- A.@Key
- B.@Primary
- C.@Id
- 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 →