Where can I find example to use findAllSlice?

Hi,

Where can I find sample for below

  • The JmixDataRepository methods returning Page perform additional count request to the database to provide total number of items and pages in the Page object. If you don’t need the number of pages in your logic, use the new findAllSlice() methods returning Slice. This will reduce the load on the database.

Regards,
CK

Hi CK,

Here is an example of using findAllSlice in the view controller:

public class FooListView extends StandardListView<Foo> {

    @Autowired
    private FooRepository repository;

    @Install(to = "foosDl", target = Target.DATA_LOADER, subject = "loadFromRepositoryDelegate")
    private List<Foo> loadDelegate(Pageable pageable, JmixDataRepositoryContext context) {
        return repository.findAllSlice(pageable, context).getContent();
    }

Regards,
Konstantin