Revision 851c8d2e
Added by Andreas Kohlbecker almost 8 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/query/OrderHint.java | ||
---|---|---|
59 | 59 |
|
60 | 60 |
public final String LUCENE_SCORE = "LUCENE_SCORE"; |
61 | 61 |
|
62 |
public static final List<OrderHint> ORDER_BY_ID = Arrays.asList(new OrderHint[]{new OrderHint("id", SortOrder.ASCENDING)});
|
|
62 |
public static final OrderHint ORDER_BY_ID = new OrderHint("id", SortOrder.ASCENDING);
|
|
63 | 63 |
|
64 |
public static final List<OrderHint> ORDER_BY_TITLE_CACHE = Arrays.asList(new OrderHint[]{new OrderHint("titleCache", SortOrder.ASCENDING)});
|
|
64 |
public static final OrderHint ORDER_BY_ID_DESC = new OrderHint("id", SortOrder.DESCENDING);
|
|
65 | 65 |
|
66 |
public static final List<OrderHint> NOMENCLATURAL_SORT_ORDER = Arrays.asList(new OrderHint[]{new OrderHint(NomenclaturalSortOrderBrigde.NAME_SORT_FIELD_NAME, SortOrder.ASCENDING)}); |
|
66 |
public static final OrderHint ORDER_BY_TITLE_CACHE = new OrderHint("titleCache", SortOrder.ASCENDING); |
|
67 |
|
|
68 |
public static final OrderHint ORDER_BY_TITLE_CACHE_DESC = new OrderHint("titleCache", SortOrder.DESCENDING); |
|
69 |
|
|
70 |
public static final OrderHint NOMENCLATURAL_SORT_ORDER = new OrderHint(NomenclaturalSortOrderBrigde.NAME_SORT_FIELD_NAME, SortOrder.ASCENDING); |
|
71 |
|
|
72 |
public static final OrderHint NOMENCLATURAL_SORT_ORDER_DESC = new OrderHint(NomenclaturalSortOrderBrigde.NAME_SORT_FIELD_NAME, SortOrder.DESCENDING); |
|
73 |
|
|
74 |
public static final OrderHint BY_ORDER_INDEX = new OrderHint("orderIndex", SortOrder.ASCENDING); |
|
75 |
|
|
76 |
public static final OrderHint BY_ORDER_INDEX_DESC = new OrderHint("orderIndex", SortOrder.ASCENDING); |
|
77 |
|
|
78 |
|
|
79 |
public List<OrderHint> asList() { |
|
80 |
return Arrays.asList(new OrderHint[]{this}); |
|
81 |
} |
|
67 | 82 |
|
68 | 83 |
/** |
69 | 84 |
* @param clazz |
... | ... | |
71 | 86 |
*/ |
72 | 87 |
public static List<OrderHint> defaultOrderHintsFor(Class<? extends CdmBase> clazz) { |
73 | 88 |
if (clazz.isAssignableFrom(IdentifiableEntity.class)) { |
74 |
return ORDER_BY_TITLE_CACHE; |
|
89 |
return ORDER_BY_TITLE_CACHE.asList();
|
|
75 | 90 |
} else { |
76 |
return ORDER_BY_ID; |
|
91 |
return ORDER_BY_ID.asList();
|
|
77 | 92 |
} |
78 | 93 |
} |
79 | 94 |
|
Also available in: Unified diff
#5482 web services now support different orderBy modes