【发布时间】:2011-05-13 14:04:21
【问题描述】:
我有以下查询在 Hibernate 下有效,但在 eclipse 下无效:
select o from Organisation o where o.code=:code and o.type=:type
我不清楚为什么会这样,我希望其他人可以为我们详细说明。返回的错误是:
Caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Error compiling the query [select o from Organisation o where o.code=:code and o.type=:type]. Unknown entity type [Organisation].
除了在 persistence.xml 文件中切换提供程序类以指示我们现在使用 eclipselink 之外,我们没有进行其他更改。
【问题讨论】:
标签: hibernate orm jpa eclipselink jpql