All quizzes
Free quiz · 20 questions in the bank

JPA quiz

Test your JPA knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

Why is JPA commonly used together with the Spring Framework, specifically via Spring Data JPA?

Questions in this quiz
  1. Why is JPA commonly used together with the Spring Framework, specifically via Spring Data JPA?
  2. What does a JPA "cascade" setting (like `cascade = CascadeType.ALL` on a relationship) control?
  3. What is the "N+1 query problem" as it commonly arises in JPA/Hibernate applications using lazy-loaded relationships?
  4. What is the JPA `@Transactional` annotation (or the broader transaction management it represents) used for?
  5. What does JPA's support for entity relationships (`@OneToMany`, `@ManyToOne`, `@ManyToMany`) allow developers to express?
  6. What is "optimistic locking" in JPA, typically implemented via a `@Version` annotated field?
  7. What is the difference between "eager" and "lazy" fetching strategies for a JPA entity relationship (e.g. `fetch = FetchType.LAZY`)?
  8. What is the relationship between JPA and Hibernate?
  9. How can a JPQL query use `JOIN FETCH` to help address the N+1 query problem for a specific query?
  10. What is an `EntityManager` in JPA, and what role does it play?
  11. What does the JPA Criteria API provide as an alternative to writing JPQL query strings directly?
  12. What is JPQL (Java Persistence Query Language), and how does it differ from writing raw SQL?
Gaps to close?
Read the curated JPA notes — core concepts, patterns, interview prep.
JPA notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web