[JPA] Repository

DAUN JO·2021년 7월 13일
0

Spring

목록 보기
5/6
post-thumbnail

Query 생성

Method 이름에서 쿼리 생성

public interface UserRepository extends Repository<User, Long> {

  List<User> findByEmailAddressAndLastname(String emailAddress, String lastname);
}

=>
select u from User u where u.emailAddress = ?1 and u.lastname = ?2

Keyword

Reference
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods.query-creation

https://docs.spring.io/spring-data/jpa/docs/1.5.0.RELEASE/reference/html/jpa.repositories.html

profile
🍕

0개의 댓글