Class AnnotatedTypeSource
java.lang.Object
org.hibernate.search.mapper.pojo.mapping.definition.annotation.AnnotatedTypeSource
A source of types to be processed for annotations by Hibernate Search.
This is mainly useful when the following options are enabled:
AnnotationMappingConfigurationContext.discoverAnnotatedTypesFromRootMappingAnnotations(boolean)
discovering annotated types that are also annotated with root mapping annotations}.AnnotationMappingConfigurationContext.discoverJandexIndexesFromAddedTypes(boolean)
discovering Jandex indexes from types added}
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
static AnnotatedTypeSource
empty()
static AnnotatedTypeSource
fromClasses
(Class<?> clazz, Class<?>... otherClasses) static AnnotatedTypeSource
fromClasses
(Set<Class<?>> annotatedClasses) static AnnotatedTypeSource
fromJandexIndex
(org.jboss.jandex.IndexView jandexIndex)
-
Method Details
-
fromClasses
- Parameters:
clazz
- A class annotated with Hibernate Search annotations, or (if taking advantage ofJandex-based discovery
) a class within a JAR that contains other classes annotated with Hibernate Search annotations.otherClasses
- Other classes following the same requirements asfirstClass
.- Returns:
- A source that
adds
the provided classes explicitly, and by default also allowsother classes from the same JAR to be discovered automatically
if they areannotated with root mapping annotations
such asSearchEntity
orProjectionConstructor
.
-
fromClasses
- Parameters:
annotatedClasses
- Classes annotated with Hibernate Search annotations.- Returns:
- A source that
adds
the provided classes explicitly. Note thatother classes from the same JAR may be discovered automatically
if they areannotated with root mapping annotations
such asSearchEntity
orProjectionConstructor
.
-
empty
- Returns:
- An empty source. Only useful if you're planning on using
programmatic mapping
.
-
fromJandexIndex
- Parameters:
jandexIndex
- A Jandex index containing types annotated with Hibernate Search annotations.- Returns:
- A source for
discovering types annotated with root mapping annotations
within the given index.
-
apply
-