मैं दो आईडी कॉलम का चयन कर रहा हूँ, लेकिन त्रुटि निर्दिष्ट करने के में मौजूद नहीं थे:क्वेरी प्राप्त कर रहा है में शामिल होने के लिए निर्दिष्ट है, लेकिन प्राप्त किए गए सहयोग के मालिक का चयन सूची
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=null,tableName=REVISIONS,tableAlias=revision1_,origin=ENTITY_CHANGED_IN_REVISION entitychan0_,columns={entitychan0_.REV_ID ,className=ru.csbi.registry.domain.envers.Revision}}] [ select ec.id as entityChangeId, r.id as revisionId from ru.csbi.registry.domain.envers.EntityChange as ec inner join fetch ec.revision as r where ec.groupEntityId = :groupEntityId and ec.groupName = :groupName and r.timestamp < :entityDateFrom and r.timestamp > :entityDateTo and ( ec.revisionType in (0, 5, 1, 4, 2) and not (ec.otherGroupEntityModified = false and ec.thisGroupEntityModified = true and ec.rowDataModified = false and ec.collectionOfNotGroupEntityModified = false ) ) group by ec.id, r.id having count(*) > :start order by r.id desc]
कुछ कोड:
String hql = " select ec.id as entityChangeId, r.id as revisionId from EntityChange as ec " +
" inner join fetch ec.revision as r " +
" where ec.groupEntityId = :groupEntityId" +
" and ec.groupName = :groupName " +
" and r.timestamp < :entityDateFrom " +
" and r.timestamp > :entityDateTo " +
" and (" +
" ec.revisionType in (" +
RevisionType.ADD.getRepresentation() + ", " +
RevisionType.ONLY_DATA_PROPERTY_MOD.getRepresentation() + ", " +
RevisionType.BOTH_COLLECTION_AND_PROPERTY_MOD.getRepresentation() + ", " +
RevisionType.ONLY_COLLECTION_PROPERTY_MOD.getRepresentation() + ", " +
RevisionType.DEL.getRepresentation() +
") " +
" and not ("+
"ec.otherGroupEntityModified = false and " +
"ec.thisGroupEntityModified = true and " +
"ec.rowDataModified = false and " +
"ec.collectionOfNotGroupEntityModified = false " +
" ) " +
" ) " +
" group by ec.id, r.id " +
" having count(*) > :start" +
" order by r.id desc";
त्रुटि को कैसे ठीक करें और मैं क्या गलत कर रहा हूं?
इस प्रश्न के भविष्य के खोजकर्ताओं के लिए, मेरी स्थिति में, मैं एक आलसी विशेषता में शामिल हो रहा था। जब मैं शामिल होने वाले खंड को हटा देता हूं तो इसे हल किया गया था। – merveotesi