Search in sources :

Example 1 with DatastoreQueryOptions

use of com.google.cloud.spring.data.datastore.core.DatastoreQueryOptions in project spring-cloud-gcp by GoogleCloudPlatform.

the class SimpleDatastoreRepositoryTests method findAllSortAsc.

@Test
void findAllSortAsc() {
    this.simpleDatastoreRepository.findAll(Sort.by(new Sort.Order(Sort.Direction.DESC, "property1"), new Sort.Order(Sort.Direction.ASC, "property2")));
    DatastoreQueryOptions opts = new DatastoreQueryOptions.Builder().setSort(Sort.by(new Sort.Order(Sort.Direction.DESC, "property1"), new Sort.Order(Sort.Direction.ASC, "property2"))).build();
    verify(this.datastoreTemplate).findAll(Object.class, opts);
}
Also used : DatastoreQueryOptions(com.google.cloud.spring.data.datastore.core.DatastoreQueryOptions) Sort(org.springframework.data.domain.Sort) Test(org.junit.jupiter.api.Test)

Aggregations

DatastoreQueryOptions (com.google.cloud.spring.data.datastore.core.DatastoreQueryOptions)1 Test (org.junit.jupiter.api.Test)1 Sort (org.springframework.data.domain.Sort)1