Hi,
Is anyone using Holod Platform Vaadin Flow API (https://docs.holon-platform.com/current/reference/holon-vaadin-flow.html) ?
I’m looking for some examples on the usage of datasource lazy loading? I’m using below code to get unique values of Product → Category but am getting duplicates. Somewhere the problem is in filtering I believe. Please help
DataProvider.fromFilteringCallbacks(query -> {
return datastore.query(Product.TARGET)
.restrict(query.getLimit(), query.getOffset())
.stream(Product.PROPERTY_SET)
.distinct()
.filter(pb -> {
String filter = query.getFilter().orElse(null);
return StringUtils.containsIgnoreCase(pb.getValue(Product.CATEGORY), filter);
})
;
}, query -> {
return (int) datastore.query(Product.TARGET)
.stream(Product.PROPERTY_SET)
.distinct()
.filter(pb -> {
String filter = query.getFilter().orElse(null);
return StringUtils.containsIgnoreCase(pb.getValue(Product.CATEGORY), filter);
})
.count();
}))