*
* @deprecated Since 1.2. This is a utility method that handles a very specific case.
* It shouldn't be in DataContext.
*/
public void prefetchRelationships(SelectQuery query, List objects) {
QueryMetadata metadata = query.getMetaData(getEntityResolver());
Collection prefetches = metadata.getPrefetchTree() != null ? query
.getPrefetchTree()
.nonPhantomNodes() : Collections.EMPTY_LIST;
if (objects == null || objects.size() == 0 || prefetches.size() == 0) {
return;
}
ObjEntity entity = metadata.getObjEntity();
Iterator prefetchesIt = prefetches.iterator();
while (prefetchesIt.hasNext()) {
PrefetchTreeNode prefetch = (PrefetchTreeNode) prefetchesIt.next();
String path = prefetch.getPath();
if (path.indexOf('.') >= 0) {