In our project we are trying to upgrade the hibernate version. During the upgrade we discovered failures of the form:
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=stea,role=null,tableName=STELLENANGEBOT,tableAlias=stellenang3_,origin=ASDATEN asdaten2_,columns={asdaten2_.LSTELLENID ,className=de.arbeitsagentur.vam.dom.fachentitaeten.Stellenangebot}}] [
<![CDATA[SELECT distinct asf
FROM Asfavorit asf
LEFT JOIN FETCH asf.asdaten
LEFT JOIN FETCH asf.asdaten.stellenangebot stea
LEFT JOIN FETCH stea.stellenlokation lok
LEFT JOIN FETCH stea.arbeitgeber ag
LEFT JOIN FETCH ag.kunde
WHERE asf.bewerber.id = :bewerberId
]]>
However, the query above worked fine for hibernate version 3.2.6.ga. Any suggestions?
P.S.: A similar topic was
viewtopic.php?t=964901, but it did not really help for us.