사용자 도구

사이트 도구


java:jpa:springdatajpa

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
java:jpa:springdatajpa [2019/04/22 14:36]
kwon37xi
java:jpa:springdatajpa [2019/06/04 14:20]
kwon37xi
줄 141: 줄 141:
   * interface 기반으로 projection 가능.   * interface 기반으로 projection 가능.
  
 +===== @Query에 SpEL 지원 =====
 +  * [[https://spring.io/blog/2014/07/15/spel-support-in-spring-data-jpa-query-definitions|SpEL support in Spring Data JPA @Query definitions]]
  
 +<code java>
 +@Query("select u from User u where u.age = ?#{[0]}")
 +List<User> findUsersByAge(int age);
 +
 +@Query("select u from User u where u.firstname = :#{#customer.firstname}")
 +List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer);
 +</code>
  
 ===== 참조 ===== ===== 참조 =====
java/jpa/springdatajpa.txt · 마지막으로 수정됨: 2024/02/07 14:43 저자 kwon37xi