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 voidstatic AnnotatedTypeSourceempty()static AnnotatedTypeSourcefromClasses(Class<?> clazz, Class<?>... otherClasses) static AnnotatedTypeSourcefromClasses(Set<Class<?>> annotatedClasses) static AnnotatedTypeSourcefromJandexIndex(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
addsthe provided classes explicitly, and by default also allowsother classes from the same JAR to be discovered automaticallyif they areannotated with root mapping annotationssuch asSearchEntityorProjectionConstructor.
-
fromClasses
- Parameters:
annotatedClasses- Classes annotated with Hibernate Search annotations.- Returns:
- A source that
addsthe provided classes explicitly. Note thatother classes from the same JAR may be discovered automaticallyif they areannotated with root mapping annotationssuch asSearchEntityorProjectionConstructor.
-
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 annotationswithin the given index.
-
apply
-