List of usage examples for org.springframework.data.domain Sort Sort
private Sort(Direction direction, List<String> properties)
From source file:it.reply.orchestrator.controller.ControllerTestUtils.java
public static Pageable createDefaultPageable() { return new PageRequest(0, 10, new Sort(Direction.DESC, AbstractResourceEntity.CREATED_COLUMN_NAME)); }
From source file:com.rorrell.zootest.data.EntityRepository.java
default Sort sortByPropertyAsc(String property) { return new Sort(Sort.Direction.ASC, property); }
From source file:com.recursivechaos.stoopbot.service.ItemsService.java
public String findNewestItemId() { return itemsDao.findAll(new Sort(Sort.Direction.DESC, "date")).get(0).getId(); }
From source file:com.zbum.example.springweb.somebiz.service.impl.SomeServiceImpl.java
public List<User> findUser() { return userRepository.findAll(new Sort(Sort.Direction.ASC, "id")); }
From source file:hu.petabyte.redflags.web.svc.FiltersSvc.java
public List<UserFilter> getFilters() { List<UserFilter> r = filters.findByUserId(accounts.getCurrentUserId(), new Sort(Sort.Direction.DESC, "id")); for (UserFilter f : r) { filter.fill(f);/*from w w w . j av a2s .c o m*/ } return r; }
From source file:io.gravitee.repository.mongodb.management.internal.page.PageMongoRepositoryImpl.java
public int findMaxPageOrderByApi(String apiId) { Query query = new Query(); query.limit(1);/*w ww . j av a 2s . c o m*/ query.with(new Sort(Sort.Direction.DESC, "order")); query.addCriteria(Criteria.where("api").is(apiId)); PageMongo page = mongoTemplate.findOne(query, PageMongo.class); return (page != null) ? page.getOrder() : 0; }
From source file:th.co.geniustree.dental.service.EmployeeService.java
private Sort sortByIdAsc() { return new Sort(Sort.Direction.DESC, "id"); }
From source file:com.trenako.results.SearchRangeTests.java
@Test public void shouldReturnSearchRangeParametersAsMap() { SearchRange range = new SearchRange(25, new Sort(Direction.DESC, "name"), SINCE, MAX); Map<String, Object> params = range.asMap(); String expected = "{dir=DESC, max=501171ab575ef9abd1a0c71f, " + "since=501171ab575ef9abd1a0c71e, size=25, sort=name}"; assertNotNull(params);//from ww w.j av a 2 s . c om assertEquals(5, params.size()); assertEquals(expected, params.toString()); }
From source file:uk.gov.nationalarchives.discovery.taxonomy.common.repository.mongo.impl.IAViewUpdateRepositoryImpl.java
@Override public IAViewUpdate findLastIAViewUpdate() { Query query = new Query(); query.limit(1);//from w ww.j a v a 2 s . c o m query.with(new Sort(Sort.Direction.DESC, IAViewUpdate.FIELD_ID)); return mongoTemplate.findOne(query, IAViewUpdate.class); }
From source file:com.trenako.web.infrastructure.RangeRequestQueryParamsBuilderTests.java
@Test public void shouldBuildQueryParamsForDefaultRanges() { searchRange = new SearchRange(10, new Sort(Direction.DESC, "lastModified"), null, null); String queryParams = buildQueryParamsNext(searchRange); assertEquals("", queryParams); }