Repositories - JpaRepository, CrudRepository, @Query and Pageable 

    Question 1DATA JPA - CrudRepository vs JpaRepository

    Which statement correctly describes the relationship between CrudRepository and JpaRepository?

    Question 2DATA JPA - Code Snippet (CrudRepository)

    What will the following repository provide?

    public interface StudentRepository extends CrudRepository<Student, Long> { }

    Question 3DATA JPA - Paging and Sorting

    Which repository interface provides built-in methods for pagination and sorting?

    Question 4DATA JPA - Code Snippet (@Query Custom JPQL)

    What does the following method do?

    public interface EmployeeRepository extends JpaRepository<Employee, Long> { @Query("SELECT e FROM Employee e WHERE e.department = ?1") List<Employee> findByDepartment(String department); }

    Question 5DATA JPA - Derived Query Methods

    Which of the following is a valid Spring Data JPA derived query method?

    Question 6DATA JPA - Code Snippet (Pagination with Pageable)

    What is the purpose of Pageable in the following repository method?

    Page<Student> findByDepartment(String department, Pageable pageable);

    Question 7DATA JPA - @Modifying with @Query

    Which of the following is required when executing update or delete queries with @Query?

    Question 8DATA JPA - Code Snippet (@Modifying Example)

    What does the following method do?

    @Modifying @Transactional @Query("UPDATE Employee e SET e.salary = e.salary * 1.1 WHERE e.department = ?1") int increaseSalaryByDept(String department);

    Question 9DATA JPA - Return Types in Repository Methods

    Which of the following are valid return types for Spring Data repository query methods?

    Question 10DATA JPA - Native Queries

    What happens if nativeQuery = true is used in @Query?