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

What is a realistic tradeoff to weigh when relying heavily on JPA/Hibernate's automatic, convention-driven SQL generation for a performance-critical, high-throughput application feature?

Questions in this quiz
  1. What is a realistic tradeoff to weigh when relying heavily on JPA/Hibernate's automatic, convention-driven SQL generation for a performance-critical, high-throughput application feature?
  2. How can a JPQL query use `JOIN FETCH` to help address the N+1 query problem for a specific query?
  3. What is the "N+1 query problem" as it commonly arises in JPA/Hibernate applications using lazy-loaded relationships?
  4. What is the difference between "eager" and "lazy" fetching strategies for a JPA entity relationship (e.g. `fetch = FetchType.LAZY`)?
  5. What does JPA's "dirty checking" mechanism do?
  6. What is an `EntityManager` in JPA, and what role does it play?
  7. What is JPQL (Java Persistence Query Language), and how does it differ from writing raw SQL?
  8. What is the relationship between JPA and Hibernate?
  9. What does a JPA "cascade" setting (like `cascade = CascadeType.ALL` on a relationship) control?
  10. What is a realistic reason a Java application might choose to write raw native SQL queries (via `@Query(nativeQuery = true)` in Spring Data JPA, or `createNativeQuery` in raw JPA) rather than relying purely on JPQL?
  11. Why is JPA commonly used together with the Spring Framework, specifically via Spring Data JPA?
  12. What does JPA's support for entity relationships (`@OneToMany`, `@ManyToOne`, `@ManyToMany`) allow developers to express?
Gaps to close?
Read the curated JPA notes — core concepts, patterns, interview prep.
JPA notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web