-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Hello
I am a little bit confused about the sorted method in Entitystream class. (Tested in Version 1.0.0)
Do you have an example about using the Comparator on a basic context (like Company)
I was expected there is a magic mechanism that converting the comparator into a query condition like "SORTBY" "dateUpdated" "DESC"
@Test
@Order(2)
public void testfindAllLast10ElementsSortByDateUpdated() {
try {
List<RDFasttCompte> listFasttCompte = entityStream.of(RDFasttCompte.class)
.sorted(RDFasttCompte$.DATE_UPDATED, SortedField.SortOrder.DESC)
.collect(Collectors.toCollection(ArrayList::new));
listFasttCompte.forEach(fc -> log.info(">> RDFasttCompte id=" + fc.getId() + " dateUpdated=" + fc.getDateUpdated()));
// ✅ "FT.SEARCH" "fr.gms.legacy.api.redis.model.fastt.RDFasttCompteIdx" "*" "SORTBY" "dateUpdated" "DESC" "DIALECT" "2"
listFasttCompte = entityStream.of(RDFasttCompte.class)
.sorted(Comparator.comparing(RDFasttCompte$.DATE_UPDATED), SortedField.SortOrder.DESC)
.collect(Collectors.toCollection(ArrayList::new));
listFasttCompte.forEach(fc -> log.info(">> RDFasttCompte id=" + fc.getId() + " dateUpdated=" + fc.getDateUpdated()));
// ❌ "FT.SEARCH" "fr.gms.legacy.api.redis.model.fastt.RDFasttCompteIdx" "*" "DIALECT" "2"
assertTrue(listFasttCompte.size() == 10, "La liste doit contenir 10 éléments");
} catch (Exception e) {
log.error("🚨EXC : " + e.getMessage(), e);
assertTrue(false, e.getMessage());
}
}
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation