更新时间:2023-02-06 21:47:35
这里有几个问题:
ON
子句不支持括号中的多个连接条件。 / li> NoSuchMethodError
不是Hibernate会抛出的东西:-)你可能有一个旧版本的 antlr.jar
在你的类路径中的某个地方,它会被代替Hibernate期望的地方。找到它并将其删除。ON
clause does not support multiple joined conditions in parenthesis.NoSuchMethodError
is not something Hibernate would throw :-) You likely have an older version of antlr.jar
somewhere in your classpath and it gets picked up in place of the one expected by Hibernate. Find it and remove it.如果没有看到您的映射,以下内容可能不准确,但我会试着写更多适当的HQL:
Without seeing your mappings the following is likely inaccurate, but I'll take a stab at writing the more appropriate HQL:
select distinct t
from TASK t
left join fetch t.server ser
left join fetch ser.application app
left join t.prompt p with p.applicationName in ('XXX')
order by t.id
请注意,提示符
未被取用,因为您无法使用连接取出
连同与
条件。如果需要关联,您可以用内部联合抓取
和
替换它。
Note that prompt
is not fetched because you can't use join fetch
together with with
condition. You can replace it with inner join fetch
and where
if the association is required.
如果您在解决classpath问题后仍然遇到问题,请随时发布映射,如果您需要实际的HQL帮助。
If you're still having trouble after the classpath issue is resolved, feel free to post your mappings if you need help with actual HQL.