|
13 | 13 | import org.hibernate.search.mapper.orm.mapping.HibernateOrmSearchMappingConfigurer;
|
14 | 14 | import org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName;
|
15 | 15 | import org.hibernate.search.mapper.orm.search.loading.EntityLoadingCacheLookupStrategy;
|
| 16 | +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; |
| 17 | +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.SearchEntity; |
| 18 | +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.RootMapping; |
16 | 19 | import org.hibernate.search.mapper.pojo.tenancy.TenantIdentifierConverter;
|
17 | 20 | import org.hibernate.search.mapper.pojo.tenancy.spi.StringTenantIdentifierConverter;
|
18 | 21 | import org.hibernate.search.mapper.pojo.work.IndexingPlanSynchronizationStrategy;
|
@@ -152,10 +155,34 @@ private HibernateOrmMapperSettings() {
|
152 | 155 | * or a string that can be parsed into a Boolean value.
|
153 | 156 | * <p>
|
154 | 157 | * Defaults to {@link Defaults#MAPPING_BUILD_MISSING_DISCOVERED_JANDEX_INDEXES}.
|
| 158 | + * |
| 159 | + * @see org.hibernate.search.mapper.pojo.mapping.definition.annotation.AnnotationMappingConfigurationContext#buildMissingDiscoveredJandexIndexes(boolean) |
155 | 160 | */
|
156 | 161 | public static final String MAPPING_BUILD_MISSING_DISCOVERED_JANDEX_INDEXES =
|
157 | 162 | PREFIX + Radicals.MAPPING_BUILD_MISSING_DISCOVERED_JANDEX_INDEXES;
|
158 | 163 |
|
| 164 | + /** |
| 165 | + * When {@link #MAPPING_PROCESS_ANNOTATIONS annotation processing is enabled} (the default), |
| 166 | + * whether Hibernate Search should automatically discover annotated types |
| 167 | + * present in the Jandex index that are also annotated |
| 168 | + * with {@link RootMapping root mapping annotations}. |
| 169 | + * <p> |
| 170 | + * When enabled, if an annotation meta-annotated with {@link RootMapping} |
| 171 | + * is found in the Jandex index, |
| 172 | + * and a type annotated with that annotation (e.g. {@link SearchEntity} or {@link ProjectionConstructor}) is found in the Jandex index, |
| 173 | + * then that type will automatically be scanned for mapping annotations, |
| 174 | + * even if the type wasn't explicitly added. |
| 175 | + * <p> |
| 176 | + * Expects a Boolean value such as {@code true} or {@code false}, |
| 177 | + * or a string that can be parsed into a Boolean value. |
| 178 | + * <p> |
| 179 | + * Defaults to {@link Defaults#MAPPING_DISCOVER_ANNOTATED_TYPES_FROM_ROOT_MAPPING_ANNOTATIONS}. |
| 180 | + * |
| 181 | + * @see org.hibernate.search.mapper.pojo.mapping.definition.annotation.AnnotationMappingConfigurationContext#discoverAnnotatedTypesFromRootMappingAnnotations(boolean) |
| 182 | + */ |
| 183 | + public static final String MAPPING_DISCOVER_ANNOTATED_TYPES_FROM_ROOT_MAPPING_ANNOTATIONS = |
| 184 | + PREFIX + Radicals.MAPPING_DISCOVER_ANNOTATED_TYPES_FROM_ROOT_MAPPING_ANNOTATIONS; |
| 185 | + |
159 | 186 | /**
|
160 | 187 | * A configurer for the Hibernate Search mapping.
|
161 | 188 | * <p>
|
@@ -287,10 +314,13 @@ private Radicals() {
|
287 | 314 | AUTOMATIC_INDEXING_PREFIX + AutomaticIndexingRadicals.ENABLE_DIRTY_CHECK;
|
288 | 315 | public static final String QUERY_LOADING_CACHE_LOOKUP_STRATEGY = "query.loading.cache_lookup.strategy";
|
289 | 316 | public static final String QUERY_LOADING_FETCH_SIZE = "query.loading.fetch_size";
|
290 |
| - public static final String MAPPING_PROCESS_ANNOTATIONS = "mapping.process_annotations"; |
| 317 | + public static final String MAPPING_PREFIX = "mapping."; |
| 318 | + public static final String MAPPING_PROCESS_ANNOTATIONS = MAPPING_PREFIX + "process_annotations"; |
291 | 319 | public static final String MAPPING_BUILD_MISSING_DISCOVERED_JANDEX_INDEXES =
|
292 |
| - "mapping.build_missing_discovered_jandex_indexes"; |
293 |
| - public static final String MAPPING_CONFIGURER = "mapping.configurer"; |
| 320 | + MAPPING_PREFIX + "build_missing_discovered_jandex_indexes"; |
| 321 | + public static final String MAPPING_DISCOVER_ANNOTATED_TYPES_FROM_ROOT_MAPPING_ANNOTATIONS = |
| 322 | + MAPPING_PREFIX + "discover_annotated_types_from_root_mapping_annotations"; |
| 323 | + public static final String MAPPING_CONFIGURER = MAPPING_PREFIX + "configurer"; |
294 | 324 | public static final String SCHEMA_MANAGEMENT_STRATEGY = "schema_management.strategy";
|
295 | 325 | public static final String COORDINATION = "coordination";
|
296 | 326 | public static final String COORDINATION_PREFIX = COORDINATION + ".";
|
@@ -415,6 +445,7 @@ private Defaults() {
|
415 | 445 | public static final int QUERY_LOADING_FETCH_SIZE = 100;
|
416 | 446 | public static final boolean MAPPING_PROCESS_ANNOTATIONS = true;
|
417 | 447 | public static final boolean MAPPING_BUILD_MISSING_DISCOVERED_JANDEX_INDEXES = true;
|
| 448 | + public static final boolean MAPPING_DISCOVER_ANNOTATED_TYPES_FROM_ROOT_MAPPING_ANNOTATIONS = true; |
418 | 449 | public static final SchemaManagementStrategyName SCHEMA_MANAGEMENT_STRATEGY =
|
419 | 450 | SchemaManagementStrategyName.CREATE_OR_VALIDATE;
|
420 | 451 | public static final BeanReference<CoordinationStrategy> COORDINATION_STRATEGY =
|
|
0 commit comments