HibernateException:命名查询中的错误:fetchPidsBy-Nospec

时间:2014-02-26 06:18:55

标签: hibernate

**Exception:**

     Caused by: org.hibernate.HibernateException: Errors in named queries: fetchPidsBy-Nospec
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 47 more

我的hibernate查询

<query name="fetchPidsBy-Nospec">
<![CDATA[from fProductDetails fpd where fpd.existedProductId not in 
(select prd.existedProductId from fProductDetails prd inner join FProductSpecifications spec on prd.existedProductId=spec.existedProductId  ) 
order by fpd.existedProductId
        ]]>
</query>

执行查询的MY代码是

if(type!=null&& type.equals("Spec"))
{
      List<FProductDetails>fProductDetailsList=List<FProductDetails>)this.baseDao.
      findByNamedQuery("fetchPidsBy-spec");
     if(!fProductDetailsList.isEmpty())
    {
      specName.add(pDetails);
     }
 }

0 个答案:

没有答案