public static <T> SelectRequest buildQuery(Query<T> query, String prefix, StringBuffer domainBuf) {
Class<?> clazz = query.getQueriedClass();
String domain = getDomainName(clazz, prefix);
domainBuf.append(domain);
QueryOptionFetchType fetchType = (QueryOptionFetchType)query.option(QueryOptionFetchType.ID);
StringBuilder q = new StringBuilder();
switch(fetchType.fetchType){
case KEYS_ONLY: