0
내 JSF 데이터 테이블에 대한 지연로드를 구현하려고하는데 내 응용 프로그램이 JSF2.0을 사용하고 있습니다. 봄 3 및 최대 절전 모드는 4최대 절전 모드를 사용하여 데이터 테이블의 행 수를 Lazyloading
나는 내가
@Entity
@Table(name = "V_REQUESTS")
@NamedQueries({
@NamedQuery(name = "Request.count", query = "SELECT COUNT(r) FROM <viewname> r")
})
public class Request {
문제 내가 직면하고 Entity 클래스에
@Named("reqMB")
@Scope("request")
public class RequestManagedBean implements Serializable {
// other code .....
lazyModel.setRowCount(getRequestService().getRequestCount());
....
return lazyModel;
이
@Override
public int getRequestCount() {
Query query = entityManager.createNamedQuery("Request.count");
return ((Long) query.getSingleResult()).intValue();
}
및 ManagedBean은에서 DAO에서 다음 한 weblogic 10.3.6에 응용 프로그램을 배포하려고 할 때 다음과 같은 예외가 발생합니다.
Error creating bean with name 'requestDAOImpl': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private org.hibernate.SessionFactory
net.test.request.dao.RequestDAOImpl.sessionFactory; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'SessionFactory' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed;
nested exception is org.hibernate.HibernateException:
Errors in named queries: Request.count
이 문제를 어떻게 해결할 수 있습니까?
다른 점은 다음을 사용하는 대신 lazyloading에 대한 행 개수를 가져 오는 다른 방법이 있습니까?
@NamedQueries({
@NamedQuery(name = "Request.count", query = "SELECT COUNT(r)
FROM vw_request r")})
감사
SELECT COUNT (r) FROM r; 은보기의 실제 이름을 어떻게 든 숨기려고하기 때문에 자리 표시 자입니까? 아니면 당신이 해고하는 질문입니다. –
Gimby
@Gimby 그 자리 표시 자일뿐입니다. 실제 이름은'vw_request'입니다. – user75ponic