Example usage for org.springframework.data.repository.core.support DefaultRepositoryMetadata DefaultRepositoryMetadata

List of usage examples for org.springframework.data.repository.core.support DefaultRepositoryMetadata DefaultRepositoryMetadata

Introduction

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

Prototype

public DefaultRepositoryMetadata(Class<?> repositoryInterface) 

Source Link

Document

Creates a new DefaultRepositoryMetadata for the given repository interface.

Usage

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

/**
* Returns the {@link org.springframework.data.repository.core.RepositoryMetadata} for the given repository interface.
*
* @param repositoryInterface//from   ww w. ja  va  2 s. c  o m
* @return
*/
RepositoryMetadata getRepositoryMetadata(Class<?> repositoryInterface) {
    return Repository.class.isAssignableFrom(repositoryInterface)
            ? new DefaultRepositoryMetadata(repositoryInterface)
            : new AnnotationRepositoryMetadata(repositoryInterface);
}

From source file:com._4dconcept.springframework.data.marklogic.repository.query.PartTreeMarklogicQueryTest.java

private PartTreeMarklogicQuery createQueryForMethod(String methodName, Class<?>... paramTypes) {

    try {/*ww  w  .  ja v  a 2 s  . com*/

        Method method = Repo.class.getMethod(methodName, paramTypes);
        ProjectionFactory factory = new SpelAwareProxyProjectionFactory();
        MarklogicQueryMethod queryMethod = new MarklogicQueryMethod(method,
                new DefaultRepositoryMetadata(Repo.class), factory);

        return new PartTreeMarklogicQuery(queryMethod, marklogicOperationsMock);
    } catch (NoSuchMethodException | SecurityException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
    }
}