Question 1: DATA JPA - Code Snippet (Entity Manager Persist)
What happens when the following code executes?
Question 2: DATA JPA - Cascade Types
Which cascade type ensures that when a parent entity is removed, its related child entities are also deleted?
Question 3: DATA JPA - Derived Query Methods
Which of the following is a valid Spring Data JPA derived query method?
Question 4: DATA JPA - Code Snippet (EAGER Loading)
What will happen in the following mapping?
Question 5: DATA JPA - Propagation Behavior
Which propagation type ensures that if a transaction already exists, the method joins it; otherwise, a new one is created?
Question 6: DATA JPA - Entity Manager merge() Method
What does entityManager.merge(entity) do in JPA?
Question 7: DATA JPA - Code Snippet (FetchType.LAZY vs EAGER)
What is the default fetch type for a @OneToMany relationship in JPA?
Question 8: DATA JPA - Code Snippet (Pagination with Pageable)
What is the purpose of Pageable in the following repository method?
Question 9: DATA JPA - N+1 Query Problem Definition
What is the N+1 problem in JPA/Hibernate?
Question 10: DATA JPA - Code Snippet (REQUIRES_NEW)
What happens in this case?
Question 11: DATA JPA - Code Snippet (Remove Entity)
What will happen when this code executes?
Question 12: DATA JPA - Bidirectional Relationships
In a bidirectional relationship, why is the mappedBy attribute important?
Question 13: DATA JPA - @Modifying with @Query
Which of the following is required when executing update or delete queries with @Query?
Question 14: DATA JPA - Code Snippet (N+1 Example)
What performance issue will occur here if `employees` is `LAZY`?
Question 15: DATA JPA - Isolation Levels
Which isolation level prevents dirty reads but allows non-repeatable reads?
Question 16: DATA JPA - @Table Annotation
What is the role of the @Table annotation in JPA?
Question 17: DATA JPA - Orphan Removal
What happens when orphanRemoval = true is set on a relationship?
Question 18: DATA JPA - Code Snippet (@Modifying Example)
What does the following method do?
Question 19: DATA JPA - Solving N+1 with Fetch Join
Which query strategy can help avoid the N+1 problem?
Question 20: DATA JPA - Code Snippet (Transactional ReadOnly)
What effect does @Transactional(readOnly = true) have?