Interface PojoTypeIndexingDependencyConfigurationContext


public interface PojoTypeIndexingDependencyConfigurationContext
  • Method Details

    • useRootOnly

      void useRootOnly()
      Declare that the bridge will only use the type directly, and will not access any mutable property.

      This is unusual, and generally only possible for bridges that are applied to immutable types (String, an enum, ...), 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 PojoTypeIndexingDependencyConfigurationContext use(String pathFromBridgedTypeToUsedValue)
      Declare that the given path is read by the bridge at index time to populate the indexed document.
      Parameters:
      pathFromBridgedTypeToUsedValue - The path from the bridged type to the value 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 path cannot be applied to the bridged type.
      See Also:
    • use

      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:
      pathFromBridgedTypeToUsedValue - The path from the bridged type to the value used by the bridge.
      Returns:
      this, for method chaining.
      Throws:
      SearchException - If the given path cannot be applied to the bridged type.
    • 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 type is not 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(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 type is not an entity type, or the given type is not an entity type, or the given path cannot be applied to the given entity type.