Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Manual Custom Queries in spring boot

public interface UserRepository extends JpaRepository<User, Long> {

  @Query(value = "SELECT * FROM USERS WHERE LASTNAME = ?1",
    countQuery = "SELECT count(*) FROM USERS WHERE LASTNAME = ?1",
    nativeQuery = true)
  Page<User> findByLastname(String lastname, Pageable pageable);
}
Source by docs.spring.io #
 
PREVIOUS NEXT
Tagged: #Manual #Custom #Queries #spring #boot
ADD COMMENT
Topic
Name
9+6 =