1 19 20 package org.apache.cayenne.map; 21 22 import java.util.Iterator ; 23 24 import org.apache.cayenne.query.Query; 25 import org.apache.cayenne.query.SelectQuery; 26 27 33 class SelectQueryBuilder extends QueryBuilder { 34 35 38 public Query getQuery() { 39 SelectQuery query = new SelectQuery(); 40 query.setRoot(getRoot()); 41 query.setName(name); 42 query.setQualifier(qualifier); 43 44 if (orderings != null && !orderings.isEmpty()) { 45 query.addOrderings(orderings); 46 } 47 48 if (prefetches != null && !prefetches.isEmpty()) { 49 Iterator it = prefetches.iterator(); 50 while(it.hasNext()) { 51 query.addPrefetch((String ) it.next()); 52 } 53 } 54 55 query.initWithProperties(properties); 57 58 return query; 59 } 60 } 61 | Popular Tags |