private static boolean isRequired(Path field, CompositeSortKey sort, Path ctx) { for (SortKey key : sort.getKeys()) { if (isRequired(field, key, ctx)) { return true; } } return false; }
private static boolean isRequired(Path field, CompositeSortKey sort, Path ctx) { for (SortKey key : sort.getKeys()) { if (isRequired(field, key, ctx)) { return true; } } return false; }
private DBObject translateCompositeSortKey(CompositeSortKey sort) { DBObject ret = null; for (SortKey key : sort.getKeys()) { if (ret == null) { ret = translateSortKey(key); } else { ret.put(translatePath(key.getField()), key.isDesc() ? -1 : 1); } } return ret; }
private SortFieldInfo[] buildSortFields(Sort sort,FieldTreeNode context) { if(sort instanceof SortKey) { return new SortFieldInfo[] {getSortField(((SortKey)sort).getField(),context,((SortKey)sort).isDesc())}; } else { List<SortKey> keys=((CompositeSortKey)sort).getKeys(); SortFieldInfo[] arr=new SortFieldInfo[ keys.size() ]; int i=0; for(SortKey key:keys) { arr[i]=getSortField(key.getField(),context,key.isDesc()); } return arr; } }
private DBObject translateCompositeSortKey(CompositeSortKey sort) { DBObject ret = null; for (SortKey key : sort.getKeys()) { if (ret == null) { ret = translateSortKey(key); } else { ret.put(translatePath(key.getField()), key.isDesc() ? -1 : 1); } } return ret; }
/** * Build sort field info starting from the given metadata context */ public static SortFieldInfo[] buildSortFields(Sort sort, FieldTreeNode context) { if (sort instanceof SortKey) { return new SortFieldInfo[]{getSortField(((SortKey) sort).getField(), context, ((SortKey) sort).isDesc())}; } else { List<SortKey> keys = ((CompositeSortKey) sort).getKeys(); SortFieldInfo[] arr = new SortFieldInfo[keys.size()]; int i = 0; for (SortKey key : keys) { arr[i++] = getSortField(key.getField(), context, key.isDesc()); } return arr; } }
/** * Build sort field info starting from the given metadata context */ public static SortFieldInfo[] buildSortFields(Sort sort, FieldTreeNode context) { if (sort instanceof SortKey) { return new SortFieldInfo[]{getSortField(((SortKey) sort).getField(), context, ((SortKey) sort).isDesc())}; } else { List<SortKey> keys = ((CompositeSortKey) sort).getKeys(); SortFieldInfo[] arr = new SortFieldInfo[keys.size()]; int i = 0; for (SortKey key : keys) { arr[i++] = getSortField(key.getField(), context, key.isDesc()); } return arr; } }