我正在尝试使用 GORM 的 executeQuery 进行简单的内部连接,但得到 QuerySyntaxException .....我相信我的 hql 没问题。这是我的查询
def query = Institution.executeQuery("select longName from Institution inner join TacticalIndustryCode.idInstitution")
log.info(query.size())
我也尝试过同样的错误:
def query = Institution.executeQuery("from Institution inner join TacticalIndustryCode.id")
这是我收到的例外情况
org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'null.idInstitution' [select longName from erebus.industryGroup.Institution inner join TacticalIndustryCode.idInstitution]
at erebus.industryGroup.TacticalIndustryCodeController$$ENunaZiV.list(TacticalIndustryCodeController.groovy:20)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)