Я пытаюсь выполнить приведенный ниже запрос гибернации, но получаю:
Caused by: 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=r,role=com.efixlab.model.RestaurantRecommendedMenuItem.restaurant,tableName=RESTAURANT,tableAlias=restaurant1_,origin=RESTAURANT_RECOMMENDED_MENU_ITEM restaurant0_,columns={restaurant0_.RESTAURANT_ID ,className=com.efixlab.model.Restaurant}}]
at org.hibernate.hql.internal.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:217) ~[hibernate-core-5.4.1.Final.jar:5.4.1.Final]
SELECT mm FROM RestaurantRecommendedMenuItem o LEFT JOIN FETCH o.restaurant r LEFT JOIN FETCH o.masterMenuItem mmi LEFT JOIN FETCH mmi.masterMenuCategory mc LEFT JOIN FETCH mc.masterMenu mm WHERE r.restaurantId = :restaurantId AND mm.masterMenuId IN
( SELECT DISTINCT m.masterMenuId FROM MasterMenu m WHERE m.restaurant.restaurantId = :restaurantId )