복잡한 커스텀 파인더를 만들고 jspx 파일을 생성하고 싶습니다. 나는 스프링 ROO에 의해 생성 된 클래스라는 지불이Spring ROO에서 복잡한 (사용자 정의) 파인더를위한 jspx 및 controllers 파일을 생성하는 방법은 무엇입니까?
(실제 코드가 일을 단순화하기 위해 수정주의하십시오) :
package com.mystuff.orm;
...
@RooJavaBean
@RooToString
public class Payment {
private Double someValue;
...
// My Custom finder!!
public static TypedQuery<PaymentSummary> findPaymentStatistics(Calendar fromDate, Calendar toDate) {
if (fromDate == null || toDate == null)
throw new IllegalArgumentException("Date period argument is required");
EntityManager em = Payment.entityManager();
TypedQuery<PaymentSummary> q = em.createQuery("select new com.mystuff.data.PaymentSummary(sum(o.someValue)) from Payment o where o.startDate >= :startDate and o.endDate <= :endDate", PaymentSummary.class);
q.setParameter("startDate", fromDate);
q.setParameter("endDate", toDate);
return q;
}
}
내가이 쿼리 파일을하여 jspx 생성 할 수있는 방법
? 내가 실행하려고 할 때마다 "파인더 --finderName findPaymentStatistics을 추가"나는 오류 메시지 :
동적 파인더
어떤 아이디어 Payment.java
에 'findPaymentStatistics'파인더 정의의 'findPaymentStatistics'토큰을 일치시킬 수없는?감사