0

请在我运行我的应用程序时遇到此错误....任何帮助请。

    java.lang.IllegalArgumentException: node to traverse cannot be null!
        org.hibernate.hql.internal.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:63)
        org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:272)
        org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
        org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
        org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
        org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
        org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:119)


org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:214)
        org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:192)
        org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1537)
        org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:285)
        sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)

这是我在我的存储库类中的代码

@Query("distinct v from voucher v where v.voucherType.typeID = :typeID ")
       public List<Voucher> findDistinctByVoucherType(@Param("typeID") Long voucherTypeId);
4

1 回答 1

0

查询没有问题。上述异常表明

distinct v from voucher v where v.voucherType.typeID = :typeID

没有返回任何结果

于 2013-07-17T16:06:26.073 回答