@Override public PrefetchTreeNode addPrefetch(String prefetchPath) { return query.addPrefetch(prefetchPath); }
/** * Creates a SelectQuery. */ public Query getQuery() { SelectQuery query = new SelectQuery(); query.setRoot(getRoot()); query.setName(name); query.setQualifier(qualifier); if (orderings != null && !orderings.isEmpty()) { query.addOrderings(orderings); } if (prefetches != null && !prefetches.isEmpty()) { Iterator it = prefetches.iterator(); while(it.hasNext()) { query.addPrefetch((String) it.next()); } } // init properties query.initWithProperties(properties); return query; } }
@Override public SelectQuery<?> buildQuery() { SelectQuery<Object> selectQuery = new SelectQuery<>(); selectQuery.setRoot(this.getRoot()); selectQuery.setName(this.getName()); selectQuery.setDataMap(dataMap); selectQuery.setQualifier(this.getQualifier()); List<Ordering> orderings = this.getOrderings(); if (orderings != null && !orderings.isEmpty()) { selectQuery.addOrderings(orderings); } List<String> prefetches = this.getPrefetches(); if (prefetches != null && !prefetches.isEmpty()) { for (String prefetch : prefetches) { selectQuery.addPrefetch(prefetch); } } // init properties selectQuery.initWithProperties(this.getProperties()); return selectQuery; }