Example usage for org.springframework.data.repository.core.support RepositoryFactoryInformation getEntityInformation

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

Introduction

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

Prototype

EntityInformation<T, ID> getEntityInformation();

Source Link

Document

Returns EntityInformation the repository factory is using.

Usage

From source file:net.daum.clix.springframework.data.rest.client.repository.RestRepositories.java

private RepositoryFactoryInformation<Object, Serializable> getRepoInfoFor(Class<?> domainClass) {

    Assert.notNull(domainClass);/* w ww. j  a va 2 s  . com*/

    for (RepositoryFactoryInformation<Object, Serializable> information : repositories.keySet()) {
        if (domainClass.equals(information.getEntityInformation().getJavaType())) {
            return information;
        }
    }

    return null;
}

From source file:net.daum.clix.springframework.data.rest.client.repository.RestRepositories.java

/**
 * Returns the {@link EntityInformation} for the given domain class.
 * //  www  .  jav a2s .  c  o  m
 * @param domainClass
 *            must not be {@literal null}.
 * @return
 */
@SuppressWarnings("unchecked")
public <T, S extends Serializable> EntityInformation<T, S> getEntityInformationFor(Class<?> domainClass) {

    RepositoryFactoryInformation<Object, Serializable> information = getRepoInfoFor(domainClass);
    return information == null ? null : (EntityInformation<T, S>) information.getEntityInformation();
}