Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); }
@Override public Sort convert(String source) { Sort sort = new Sort(); for (String attr : source.split(",")) { Sort.Direction direction; if (attr.endsWith(ORDER_DESC_POSTFIX)) { direction = Sort.Direction.DESC; attr = attr.substring(0, attr.length() - ORDER_DESC_POSTFIX.length()); } else if (attr.endsWith(ORDER_ASC_POSTFIX)) { direction = Sort.Direction.ASC; attr = attr.substring(0, attr.length() - ORDER_ASC_POSTFIX.length()); } else { direction = Sort.Direction.ASC; } sort.on(attr, direction); } return sort; } }
/** Retrieves the query to get all index actions sorted */ static Query<IndexAction> createQueryGetAllIndexActions(String transactionId) { QueryRule rule = new QueryRule(INDEX_ACTION_GROUP_ATTR, EQUALS, transactionId); QueryImpl<IndexAction> q = new QueryImpl<>(rule); q.setSort(new Sort(ACTION_ORDER)); return q; }
if (q.getSort() != null && !hasUniqueSortAttribute(entityType, q.getSort())) { LOG.debug("Query with sort without unique attribute detected: {}", q); sort = new Sort(q.getSort()); sort.on(entityType.getIdAttribute().getName()); } else if (q.getSort() == null) { LOG.debug("Query without sort detected: {}", q); sort = new Sort(entityType.getIdAttribute().getName()); } else { sort = q.getSort();
@Deprecated public static List<CategoricalOptionV2> getCategoricalOptionsForRefEntity( DataService dataService, EntityType refEntity, String language) { Sort sortOrder = stream(refEntity.getAttributes()) .filter(attribute -> attribute.isVisible() && attribute.isUnique()) .map(sortAttr -> new Sort(sortAttr.getName())) .findFirst() .orElse(null); Attribute labelAttribute = refEntity.getLabelAttribute(language); return dataService .findAll(refEntity.getId(), new QueryImpl<>().sort(sortOrder)) .map( entity -> new CategoricalOptionV2( entity.getIdValue(), entity.getString(labelAttribute.getName()))) .collect(Collectors.toList()); } }
orderBy = new Sort(refIdAttr.getName());
dataService.findAll( sortaJobExecution.getResultEntityName(), query.offset(start).pageSize(num).sort(new Sort().on(VALIDATED, DESC).on(SCORE, DESC))); findAll.forEach( mappingEntity -> {
SortV1 sortV1 = request.getSort(); if (sortV1 != null) { sort = new Sort(); for (SortV1.OrderV1 orderV1 : sortV1) { sort.on(
.setRefEntity(mailSenderPropertyType) .setMappedBy(refAttr) .setOrderBy(new Sort(KEY)) .setNillable(true) .setLabel("Properties")