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

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

Introduction

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

Prototype

public AnnotationRepositoryMetadata(Class<?> repositoryInterface) 

Source Link

Document

Creates a new AnnotationRepositoryMetadata instance looking up repository types from a RepositoryDefinition annotation.

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  w  w w  . j  a  va 2s. c  o m*/
* @return
*/
RepositoryMetadata getRepositoryMetadata(Class<?> repositoryInterface) {
    return Repository.class.isAssignableFrom(repositoryInterface)
            ? new DefaultRepositoryMetadata(repositoryInterface)
            : new AnnotationRepositoryMetadata(repositoryInterface);
}