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

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

Introduction

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

Prototype

Class<?> getIdType();

Source Link

Document

Returns the id class the given class is declared for.

Usage

From source file:springfox.documentation.spring.data.rest.EntityRequestTemplate.java

List<RequestHandler> operations() {
    List<RequestHandler> requestHandlers = newArrayList();
    for (ResourceMetadata resource : restMappings) {

        Class<?> domainType = resource.getDomainType();
        RepositoryInformation entity = repositories.getRepositoryInformationFor(domainType);
        Class<? extends Serializable> idType = entity.getIdType();
        //TODO: cache the id/type combo

        requestHandlers.add(new EntityRequestHandler(typeResolver, resource, idType, domainType,
                requestMappingInfo, handlerMethod));

    }//  w  w  w .  j  a v a 2 s.  com
    return requestHandlers;
}