@Override public <T, ID, R extends Repository<T, ?>> IdMappingRegistrar<T, R> forLookupRepository(Class<R> type) { this.lookupTypes.add(AbstractRepositoryMetadata.getMetadata(type).getDomainType()); return forRepository(type); }
@Override public boolean isPagingRepository() { return getCrudMethods().getFindAllMethod()// .map(it -> Arrays.asList(it.getParameterTypes()).contains(Pageable.class))// .orElse(false); }
@Override public <T, ID, R extends Repository<T, ?>> EntityLookupRegistrar forValueRepository(Class<R> type, Converter<T, ID> identifierMapping, Lookup<R, ID> lookup) { this.lookupTypes.add(AbstractRepositoryMetadata.getMetadata(type).getDomainType()); return forRepository(type, identifierMapping, lookup); }
/** * Returns the {@link RepositoryMetadata} for the given repository interface. * * @param repositoryInterface will never be {@literal null}. * @return */ protected RepositoryMetadata getRepositoryMetadata(Class<?> repositoryInterface) { return AbstractRepositoryMetadata.getMetadata(repositoryInterface); }
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations( T configSource, ResourceLoader loader, boolean strictMatchesOnly) { Assert.notNull(configSource, "ConfigSource must not be null!"); Assert.notNull(loader, "Loader must not be null!"); Set<RepositoryConfiguration<T>> result = new HashSet<>(); for (BeanDefinition candidate : configSource.getCandidates(loader)) { RepositoryConfiguration<T> configuration = getRepositoryConfiguration(candidate, configSource); Class<?> repositoryInterface = loadRepositoryInterface(configuration, getConfigurationInspectionClassLoader(loader)); if (repositoryInterface == null) { result.add(configuration); continue; } RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(repositoryInterface); boolean qualifiedForImplementation = !strictMatchesOnly || configSource.usesExplicitFilters() || isStrictRepositoryCandidate(metadata); if (qualifiedForImplementation && useRepositoryConfiguration(metadata)) { result.add(configuration); } } return result; }