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

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

Introduction

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

Prototype

boolean hasCustomMethod();

Source Link

Document

Returns if the configured repository interface has custom methods, that might have to be delegated to a custom implementation.

Usage

From source file:com.sinosoft.one.data.jpa.repository.support.OneRepositoryFactorySupport.java

/**
 * Validates the given repository interface as well as the given custom implementation.
 *
 * @param repositoryInformation/*w ww. j  a  v  a  2 s  . com*/
 * @param customImplementation
 */
private void validate(RepositoryInformation repositoryInformation, Object customImplementation) {

    if (null == customImplementation && repositoryInformation.hasCustomMethod()) {

        throw new IllegalArgumentException(
                String.format("You have custom methods in %s but not provided a custom implementation!",
                        repositoryInformation.getRepositoryInterface()));
    }

    validate(repositoryInformation);
}