Interface PojoPropertyIndexingDependencyConfigurationContext


  • public interface PojoPropertyIndexingDependencyConfigurationContext
    • Method Detail

      • useRootOnly

        void useRootOnly()
        Declare 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.

      • use

        default PojoPropertyIndexingDependencyConfigurationContext use​(ContainerExtractorPath extractorPathFromBridgedProperty,
                                                                       String pathFromExtractedBridgedPropertyValueToUsedValue)
        Declare that the given path is read by the bridge at index time to populate the indexed document.
        Parameters:
        extractorPathFromBridgedProperty - A container extractor path from the bridged property.
        pathFromExtractedBridgedPropertyValueToUsedValue - The path from the value of the bridged property to the values used by the bridge, as a String. The string is interpreted with default value extractors: see PojoModelPath.parse(String).
        Returns:
        this, for method chaining.
        Throws:
        SearchException - If the given extractor path cannot be applied to the bridged property, or if the given path cannot be applied to the values of the bridged property.
        See Also:
        use(ContainerExtractorPath, PojoModelPathValueNode)
      • use

        PojoPropertyIndexingDependencyConfigurationContext use​(ContainerExtractorPath extractorPathFromBridgedProperty,
                                                               PojoModelPathValueNode pathFromExtractedBridgedPropertyValueToUsedValue)
        Declare 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.

        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.
        Throws:
        SearchException - If the given extractor path cannot be applied to the bridged property, or if the given path cannot be applied to the values of the bridged property.
        See Also:
        use(ContainerExtractorPath, PojoModelPathValueNode)
      • fromOtherEntity

        @Incubating
        default PojoOtherEntityIndexingDependencyConfigurationContext fromOtherEntity​(Class<?> otherEntityType,
                                                                                      String pathFromOtherEntityTypeToBridgedType)
        Start 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 use(String) will be enough.

        Parameters:
        otherEntityType - The raw type of the other entity.
        pathFromOtherEntityTypeToBridgedType - The path from the other entity type to the bridged type, as a String. The string is interpreted with default value extractors: see PojoModelPath.parse(String). Used when the other entity changes, to collect the instances that must be reindexed.
        Returns:
        A context allowing to declare which properties
        Throws:
        SearchException - If the bridged property does not point to an entity type, or the given type is not an entity type, or the given path cannot be applied to the given entity type.
      • fromOtherEntity

        @Incubating
        default PojoOtherEntityIndexingDependencyConfigurationContext fromOtherEntity​(Class<?> otherEntityType,
                                                                                      PojoModelPathValueNode pathFromOtherEntityTypeToBridgedType)
        Start 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 use(PojoModelPathValueNode) will be enough.

        Parameters:
        otherEntityType - The raw type of the other entity.
        pathFromOtherEntityTypeToBridgedType - The path from the other entity type to the bridged type. Used when the other entity changes, to collect the instances that must be reindexed.
        Returns:
        A context allowing to declare which properties
        Throws:
        SearchException - If the bridged property does not point to an entity type, or the given type is not an entity type, or the given path cannot be applied to the given entity type.
      • fromOtherEntity

        @Incubating
        PojoOtherEntityIndexingDependencyConfigurationContext 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.

        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 use(PojoModelPathValueNode) will be enough.

        Parameters:
        otherEntityType - The raw type of the other entity.
        extractorPathFromBridgedProperty - A container extractor path from the bridged property.
        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
        Throws:
        SearchException - If the bridged property does not point to an entity type, or the given type is not an entity type, or the given extractor path cannot be applied to the bridged property, or the given path cannot be applied to the given entity type.