Class PojoPropertyIndexingDependencyConfigurationContextImpl<P>
- All Implemented Interfaces:
PojoPropertyIndexingDependencyConfigurationContext
-
Constructor Summary
ConstructorsConstructorDescriptionPojoPropertyIndexingDependencyConfigurationContextImpl(PojoBootstrapIntrospector introspector, ContainerExtractorBinder containerExtractorBinder, PojoTypeAdditionalMetadataProvider typeAdditionalMetadataProvider, BoundPojoModelPathPropertyNode<?, P> modelPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeDependencies(PojoIndexingDependencyCollectorPropertyNode<?, P> dependencyCollector) fromOtherEntity(ContainerExtractorPath extractorPathFromBridgedProperty, Class<?> otherEntityType, PojoModelPathValueNode pathFromOtherEntityTypeToBridgedPropertyExtractedType) Start the declaration of dependencies to properties of another entity, without specifying the path to that other entity.booleanuse(ContainerExtractorPath extractorPathFromBridgedProperty, PojoModelPathValueNode pathFromExtractedBridgedPropertyValueToUsedValue) Declare that the given path is read by the bridge at index time to populate the indexed document.voidDeclare that the bridge will only use the property value directly, and will not access any mutable property nested in the property value.Methods inherited from class org.hibernate.search.mapper.pojo.model.dependency.impl.AbstractPojoBridgedElementDependencyContext
isUseRootOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.model.dependency.PojoPropertyIndexingDependencyConfigurationContext
fromOtherEntity, fromOtherEntity, use, use, use
-
Constructor Details
-
PojoPropertyIndexingDependencyConfigurationContextImpl
public PojoPropertyIndexingDependencyConfigurationContextImpl(PojoBootstrapIntrospector introspector, ContainerExtractorBinder containerExtractorBinder, PojoTypeAdditionalMetadataProvider typeAdditionalMetadataProvider, BoundPojoModelPathPropertyNode<?, P> modelPath)
-
-
Method Details
-
use
public PojoPropertyIndexingDependencyConfigurationContext use(ContainerExtractorPath extractorPathFromBridgedProperty, PojoModelPathValueNode pathFromExtractedBridgedPropertyValueToUsedValue) Description copied from interface:PojoPropertyIndexingDependencyConfigurationContextDeclare that the given path is read by the bridge at index time to populate the indexed document.Every component of this path will be considered as a dependency, so it is not necessary to call this method for every subpath. In other words, if the path
"myProperty.someOtherProperty"is declared as used, Hibernate Search will automatically assume that"myProperty"is also used.- Specified by:
usein interfacePojoPropertyIndexingDependencyConfigurationContext- Parameters:
extractorPathFromBridgedProperty- A container extractor path from the bridged property.pathFromExtractedBridgedPropertyValueToUsedValue- The path from the values extracted from the bridged property to the values used by the bridge.- Returns:
this, for method chaining.- See Also:
-
fromOtherEntity
public PojoOtherEntityIndexingDependencyConfigurationContext fromOtherEntity(ContainerExtractorPath extractorPathFromBridgedProperty, Class<?> otherEntityType, PojoModelPathValueNode pathFromOtherEntityTypeToBridgedPropertyExtractedType) Description copied from interface:PojoPropertyIndexingDependencyConfigurationContextStart the declaration of dependencies to properties of another entity, without specifying the path to that other entity.Note: this is only useful when the path from the bridged type to that other entity cannot be easily represented, but the inverse path can. For almost all use cases, this method won't be useful and calling
PojoPropertyIndexingDependencyConfigurationContext.use(PojoModelPathValueNode)will be enough.- Specified by:
fromOtherEntityin interfacePojoPropertyIndexingDependencyConfigurationContext- Parameters:
extractorPathFromBridgedProperty- A container extractor path from the bridged property.otherEntityType- The raw type of the other entity.pathFromOtherEntityTypeToBridgedPropertyExtractedType- The path from the other entity type to the type of extracted values for the bridged property. Used when the other entity changes, to collect the instances that must be reindexed.- Returns:
- A context allowing to declare which properties
-
useRootOnly
public void useRootOnly()Description copied from interface:PojoPropertyIndexingDependencyConfigurationContextDeclare that the bridge will only use the property value directly, and will not access any mutable property nested in the property value.This is unusual, and generally only possible for bridges that are applied to immutable types (
String, an enum, ...) or collections of immutable types (List<String>, ...), or that do not rely on the bridged element at all (constant bridges, bridges adding the last indexing date, ...).Note that calling this method prevents from declaring any other dependency, and trying to do so will trigger an exception.
- Specified by:
useRootOnlyin interfacePojoPropertyIndexingDependencyConfigurationContext- Overrides:
useRootOnlyin classAbstractPojoBridgedElementDependencyContext
-
hasNonRootDependency
public boolean hasNonRootDependency()- Specified by:
hasNonRootDependencyin classAbstractPojoBridgedElementDependencyContext
-
contributeDependencies
public void contributeDependencies(PojoIndexingDependencyCollectorPropertyNode<?, P> dependencyCollector)
-