🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: JPA and Hibernate: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does JpaRepository<Course, Long mean?
  2. Q2. What query does findByFeeLessThanEqual(int max) run?
  3. Q3. In JPQL, what do you write after FROM?
  4. Q4. Why does CourseService.update not call repository.save()?
  5. Q5. Which annotation marks the primary key field?
  6. Q6. What happens at startup if a repository has the method findByTitel(String t) (a typo)?
  7. Q7. Inside one transaction, the same course id is loaded twice. How many SELECT queries run?
  8. Q8. An entity was loaded in a transaction that has now ended. Its title is changed. What happens?
  9. Q9. What does nativeQuery = true in @Query mean?
  10. Q10. Why does a JPA entity need a no-argument constructor?