After switching to a new version of sleep mode (suppose that this happened with the switch from JBoss 4.2.2 to JBoss 6), some requests do not work with the message:
Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName= (...)
This always happens when using this query:
SELECT entityA FROM EntityA entityA JOIN FETCH entityA.entityB LEFT JOIN FETCH entityA.entityB.someField WHERE entityA.entityB.anotherField LIKE :someParameter
The solution to this problem is to give "entityA.entityB" an alias, and then use that alias in the WHERE . But in some queries, the LEFT JOIN FETCH is not explicitly set, but still the WHERE uses the property of the reference object. Is it really not possible? What has changed, so that he unexpectedly crashed after switching to a new version of JBoss?
The next question is related to this question and includes a solution, but does not explain the problem.
source share