public boolean hasCollectionFetch ( ) { if ( fetches != null ) for ( String fetch : fetches ) { QEntity parent = entity ; final String [ ] parts = StringUtils . split ( fetch , ' ' ) ; for ( int i = 0 ; i < parts . length ; i ++ ) { // If this is a fully supported relation then continue checking if ( parent . hasRelation ( parts [ i ] ) ) { final QRelation relation = parent . getRelation ( parts [ i ] ) ; parent = relation . getEntity ( ) ; if ( relation . isCollection ( ) ) { if ( log . isTraceEnabled ( ) ) log . trace ( "Encountered fetch " + fetch + ". This resolves to " + relation + " which is a collection" ) ; return true ; } } // This covers partially-supported things like Map and other basic collections that don't have a QRelation description else if ( parent . hasNonEntityRelation ( parts [ i ] ) ) { if ( parent . isNonEntityRelationCollection ( parts [ i ] ) ) return true ; } else { log . warn ( "Encountered relation " + parts [ i ] + " on " + parent . getName ( ) + " as part of path " + fetch + ". Assuming QEntity simply does not know this relation. Assuming worst case scenario (collection join is involved)" ) ; return true ; } } } return false ; }
Returns true if one of the fetches specified will result in a collection being pulled back