📜  Spring Boot 中的手动自定义查询 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:21.707000             🧑  作者: Mango

代码示例1
public interface UserRepository extends JpaRepository {

  @Query(value = "SELECT * FROM USERS WHERE LASTNAME = ?1",
    countQuery = "SELECT count(*) FROM USERS WHERE LASTNAME = ?1",
    nativeQuery = true)
  Page findByLastname(String lastname, Pageable pageable);
}