Example usage for org.springframework.data.repository.core RepositoryInformation getCrudMethods

List of usage examples for org.springframework.data.repository.core RepositoryInformation getCrudMethods

Introduction

In this page you can find the example usage for org.springframework.data.repository.core RepositoryInformation getCrudMethods.

Prototype

CrudMethods getCrudMethods();

Source Link

Document

Returns CrudMethods meta information for the repository.

Usage

From source file:com.drillmap.crm.repository.extensions.invoker.CrudRepositoryInvoker.java

/**
 * Creates a new {@link CrudRepositoryInvoker} for the given {@link CrudRepository}, {@link RepositoryInformation} and
 * {@link ConversionService}./*from   w ww.  ja va 2s .c  o  m*/
 * 
 * @param repository must not be {@literal null}.
 * @param information must not be {@literal null}.
 * @param conversionService must not be {@literal null}.
 */
public CrudRepositoryInvoker(CrudRepository<Object, Serializable> repository, RepositoryInformation information,
        ConversionService conversionService) {

    super(repository, information, conversionService);
    this.repository = repository;
    this.crudMethods = information.getCrudMethods();

    this.customSaveMethod = isRedeclaredMethod(crudMethods.getSaveMethod());
    this.customFindOneMethod = isRedeclaredMethod(crudMethods.getFindOneMethod());
    this.customDeleteMethod = isRedeclaredMethod(crudMethods.getDeleteMethod());
}

From source file:com.drillmap.crm.repository.extensions.invoker.ReflectionRepositoryInvoker.java

/**
 * Creates a new {@link ReflectionRepositoryInvoker} for the given repository, {@link RepositoryInformation} and
 * {@link ConversionService}./*from  w w w. jav  a  2  s.c  o m*/
 * 
 * @param repository must not be {@literal null}.
 * @param information must not be {@literal null}.
 * @param conversionService must not be {@literal null}.
 */
public ReflectionRepositoryInvoker(Object repository, RepositoryInformation information,
        ConversionService conversionService) {

    Assert.notNull(repository, "Repository must not be null!");
    Assert.notNull(information, "RepositoryInformation must not be null!");
    Assert.notNull(conversionService, "ConversionService must not be null!");

    this.repository = repository;
    this.methods = information.getCrudMethods();
    this.information = information;
    this.conversionService = conversionService;
}