Codota Logo
org.springframework.data.domain
Code IndexAdd Codota to your IDE (free)

How to use org.springframework.data.domain

Best Java code snippets using org.springframework.data.domain (Showing top 20 results out of 1,710)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: ctripcorp/apollo

public PageDTO(List<T> content, Pageable pageable, long total) {
 this.total = total;
 this.content = content;
 this.page = pageable.getPageNumber();
 this.size = pageable.getPageSize();
}
origin: stackoverflow.com

 Pageable topTen = new PageRequest(0, 10);
Page<User> result = repository.findByUsername("Matthews", topTen);
Assert.assertThat(result.isFirstPage(), is(true));
origin: spring-projects/spring-data-mongodb

  private static Direction toDirection(Sort sort, String property) {

    if (sort.isUnsorted()) {
      return Direction.DESC;
    }

    Order order = sort.getOrderFor(property);
    return order == null ? Direction.DESC : order.isAscending() ? Direction.ASC : Direction.DESC;
  }
}
origin: ctripcorp/apollo

 @GetMapping("/by-namespace/count")
 public long getInstancesCountByNamespace(@RequestParam("appId") String appId,
                     @RequestParam("clusterName") String clusterName,
                     @RequestParam("namespaceName") String namespaceName) {
  Page<Instance> instances = instanceService.findInstancesByNamespace(appId, clusterName,
    namespaceName, PageRequest.of(0, 1));
  return instances.getTotalElements();
 }
}
origin: ctripcorp/apollo

public List<App> findAll(Pageable pageable) {
 Page<App> page = appRepository.findAll(pageable);
 return page.getContent();
}
origin: ctripcorp/apollo

private int check() {
 PageRequest pageable = PageRequest.of(0, 1);
 appService.findAll(pageable);
 return 0;
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the {@literal minProperties}.
 *
 * @param count the allowed minimal number of properties.
 * @return new instance of {@link ObjectJsonSchemaObject}.
 */
public ObjectJsonSchemaObject minProperties(int count) {
  Bound<Integer> upper = this.propertiesCount != null ? this.propertiesCount.getUpperBound() : Bound.unbounded();
  return propertiesCount(Range.of(Bound.inclusive(count), upper));
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the valid length range ({@literal maxLength}) for a valid field.
 *
 * @param length
 * @return new instance of {@link StringJsonSchemaObject}.
 */
public StringJsonSchemaObject maxLength(int length) {
  Bound<Integer> lower = this.length != null ? this.length.getLowerBound() : Bound.unbounded();
  return length(Range.of(lower, Bound.inclusive(length)));
}
origin: spring-projects/spring-data-jpa

@Override
public boolean isIgnoreCase() {
  return super.isIgnoreCase() || ignoreCase;
}
origin: spring-projects/spring-data-jpa

@Override
public boolean isNew(T entity) {
  return entity.isNew();
}
origin: spring-projects/spring-data-redis

/**
 * Return {@link Optional} lower bound from {@link Range}.
 *
 * @param range
 * @param <T>
 * @return
 * @since 2.0.9
 */
static <T extends Comparable<T>> Optional<T> getLowerBound(org.springframework.data.domain.Range<T> range) {
  return range.getLowerBound().getValue();
}
origin: spring-projects/spring-data-redis

/**
 * Return {@link Optional} upper bound from {@link Range}.
 *
 * @param range
 * @param <T>
 * @return
 * @since 2.0.9
 */
static <T extends Comparable<T>> Optional<T> getUpperBound(org.springframework.data.domain.Range<T> range) {
  return range.getUpperBound().getValue();
}
origin: stackoverflow.com

 Pageable topTen = new PageRequest(0, 10);
List<User> result = repository.findByUsername("Matthews", topTen);
origin: ctripcorp/apollo

private int check() {
 PageRequest pageable = PageRequest.of(0, 1);
 appService.findAll(pageable);
 return 0;
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the {@literal maxItems}.
 *
 * @param count the allowed minimal number of array items.
 * @return new instance of {@link ArrayJsonSchemaObject}.
 */
public ArrayJsonSchemaObject minItems(int count) {
  Bound<Integer> upper = this.range != null ? this.range.getUpperBound() : Bound.unbounded();
  return range(Range.of(Bound.inclusive(count), upper));
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the {@literal maxProperties}.
 *
 * @param count the allowed maximum number of properties.
 * @return new instance of {@link ObjectJsonSchemaObject}.
 */
public ObjectJsonSchemaObject maxProperties(int count) {
  Bound<Integer> lower = this.propertiesCount != null ? this.propertiesCount.getLowerBound() : Bound.unbounded();
  return propertiesCount(Range.of(lower, Bound.inclusive(count)));
}
origin: macrozheng/mall

@Override
public Page<EsProduct> search(String keyword, Integer pageNum, Integer pageSize) {
  Pageable pageable = new PageRequest(pageNum, pageSize);
  return productRepository.findByNameOrSubTitleOrKeywords(keyword, keyword, keyword, pageable);
}
origin: ctripcorp/apollo

@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
 PageableHandlerMethodArgumentResolver pageResolver =
     new PageableHandlerMethodArgumentResolver();
 pageResolver.setFallbackPageable(PageRequest.of(0, 10));
 argumentResolvers.add(pageResolver);
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the valid length range ({@literal minLength}) for a valid field.
 *
 * @param length
 * @return new instance of {@link StringJsonSchemaObject}.
 */
public StringJsonSchemaObject minLength(int length) {
  Bound<Integer> upper = this.length != null ? this.length.getUpperBound() : Bound.unbounded();
  return length(Range.of(Bound.inclusive(length), upper));
}
origin: spring-projects/spring-data-mongodb

/**
 * Define the {@literal maxItems}.
 *
 * @param count the allowed maximal number of array items.
 * @return new instance of {@link ArrayJsonSchemaObject}.
 */
public ArrayJsonSchemaObject maxItems(int count) {
  Bound<Integer> lower = this.range != null ? this.range.getLowerBound() : Bound.unbounded();
  return range(Range.of(lower, Bound.inclusive(count)));
}
org.springframework.data.domain

Most used classes

  • PageRequest
    Basic Java Bean implementation of Pageable.
  • Sort
    Sort option for queries. You have to provide at least a list of properties to sort for that must not
  • Page
    A page is a sublist of a list of objects. It allows gain information about the position of it in the
  • PageImpl
    Basic Page implementation.
  • Pageable
    Abstract interface for pagination information.
  • Sort$Direction,
  • Example,
  • SliceImpl,
  • Persistable,
  • ExampleMatcher,
  • Slice,
  • Range,
  • ExampleMatcher$PropertyValueTransformer,
  • Range$Bound,
  • Sort$NullHandling,
  • AfterDomainEventPublication,
  • AuditorAware,
  • DomainEvents,
  • ExampleMatcher$PropertySpecifiers
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now