/** * Obtains all {@link Metamodel} instances of the current {@link ApplicationContext}. * * @return */ private Set<Metamodel> getMetamodels() { if (beanFactory == null) { throw new IllegalStateException("BeanFactory must not be null!"); } Collection<EntityManagerFactory> factories = BeanFactoryUtils .beansOfTypeIncludingAncestors(beanFactory, EntityManagerFactory.class).values(); return factories.stream() // .map(EntityManagerFactory::getMetamodel) // .collect(StreamUtils.toUnmodifiableSet()); } }
/** * Creates a new {@link JpaMetamodel} for the given JPA {@link Metamodel}. * * @param metamodel must not be {@literal null}. */ private JpaMetamodel(Metamodel metamodel) { Assert.notNull(metamodel, "Metamodel must not be null!"); this.metamodel = metamodel; this.managedTypes = Lazy.of(() -> metamodel.getManagedTypes().stream() // .map(ManagedType::getJavaType) // .filter(it -> it != null) // .collect(StreamUtils.toUnmodifiableSet())); }
/** * Returns an unmodifiable {@link Set} of all underlying {@link HttpMethod}s. * * @return */ default Set<HttpMethod> toSet() { return stream().collect(StreamUtils.toUnmodifiableSet()); }
@Override public Set<MethodMetadata> getMethods(String name) { Assert.hasText(name, "Method name must not be null or empty"); return methodMetadataSet.stream() // .filter(it -> it.getMethodName().equals(name)) // .collect(StreamUtils.toUnmodifiableSet()); } }
/** * Obtains all {@link Metamodel} instances of the current {@link ApplicationContext}. * * @return */ private Set<Metamodel> getMetamodels() { if (beanFactory == null) { throw new IllegalStateException("BeanFactory must not be null!"); } Collection<EntityManagerFactory> factories = BeanFactoryUtils .beansOfTypeIncludingAncestors(beanFactory, EntityManagerFactory.class).values(); return factories.stream() // .map(EntityManagerFactory::getMetamodel) // .collect(StreamUtils.toUnmodifiableSet()); } }
/** * Creates a new {@link JpaMetamodel} for the given JPA {@link Metamodel}. * * @param metamodel must not be {@literal null}. */ private JpaMetamodel(Metamodel metamodel) { Assert.notNull(metamodel, "Metamodel must not be null!"); this.metamodel = metamodel; this.managedTypes = Lazy.of(() -> metamodel.getManagedTypes().stream() // .map(ManagedType::getJavaType) // .filter(it -> it != null) // .collect(StreamUtils.toUnmodifiableSet())); }
@Nonnull @Override public Set<ConvertiblePair> getConvertibleTypes() { return Streamable.of(wrapperTypes)// .map(it -> new ConvertiblePair(NullableWrapper.class, it))// .stream().collect(StreamUtils.toUnmodifiableSet()); }
/** * Tries to detect a custom implementation for a repository bean by classpath scanning. * * @param lookup must not be {@literal null}. * @return the {@code AbstractBeanDefinition} of the custom implementation or {@literal null} if none found. */ public Optional<AbstractBeanDefinition> detectCustomImplementation(ImplementationLookupConfiguration lookup) { Assert.notNull(lookup, "ImplementationLookupConfiguration must not be null!"); Set<BeanDefinition> definitions = implementationCandidates.getOptional() .orElseGet(() -> findCandidateBeanDefinitions(lookup)).stream() // .filter(lookup::matches) // .collect(StreamUtils.toUnmodifiableSet()); return SelectionSet // .of(definitions, c -> c.isEmpty() ? Optional.empty() : throwAmbiguousCustomImplementationException(c)) // .filterIfNecessary(lookup::hasMatchingBeanName) // .uniqueResult() // .map(AbstractBeanDefinition.class::cast); }