Class HibernateSearchPropertyHelper


  • public final class HibernateSearchPropertyHelper
    extends org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
    Uses the Hibernate Search metadata to resolve property paths. This relies on the Hibernate Search annotations. If resolution fails (due to not annotated fields) the we delegate the process to the base class which works exclusively with java-bean like reflection without relying on annotations.

    Stateless and inherently threadsafe.

    Since:
    9.0
    Author:
    anistor@redhat.com
    • Constructor Detail

      • HibernateSearchPropertyHelper

        public HibernateSearchPropertyHelper​(org.hibernate.search.spi.SearchIntegrator searchFactory,
                                             org.infinispan.objectfilter.impl.syntax.parser.EntityNameResolver<Class<?>> entityNameResolver)
    • Method Detail

      • mapPropertyNamePathToFieldIdPath

        public List<?> mapPropertyNamePathToFieldIdPath​(Class<?> entityType,
                                                        String[] propertyPath)
        Overrides:
        mapPropertyNamePathToFieldIdPath in class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
      • convertToPropertyType

        public Object convertToPropertyType​(Class<?> entityType,
                                            String[] propertyPath,
                                            String value)
        Returns the given value converted into the type of the given property as determined via the field bridge of the property.
        Overrides:
        convertToPropertyType in class org.infinispan.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>>
        Parameters:
        value - the value to convert
        entityType - the type hosting the property
        propertyPath - the name of the property
        Returns:
        the given value converted into the type of the given property
      • getPrimitivePropertyType

        public Class<?> getPrimitivePropertyType​(Class<?> entityType,
                                                 String[] propertyPath)
        Overrides:
        getPrimitivePropertyType in class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
      • isRepeatedProperty

        public boolean isRepeatedProperty​(Class<?> entityType,
                                          String[] propertyPath)
        Overrides:
        isRepeatedProperty in class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
      • hasProperty

        public boolean hasProperty​(Class<?> entityType,
                                   String[] propertyPath)
        Overrides:
        hasProperty in class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
      • hasEmbeddedProperty

        public boolean hasEmbeddedProperty​(Class<?> entityType,
                                           String[] propertyPath)
        Determines whether the given property path denotes an embedded entity (not a property of such entity).
        Overrides:
        hasEmbeddedProperty in class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
        Parameters:
        entityType - the indexed type
        propertyPath - the path of interest
        Returns:
        true if the given path denotes an embedded entity of the given indexed type, false otherwise.
      • getIndexedFieldProvider

        public org.infinispan.objectfilter.impl.syntax.IndexedFieldProvider<Class<?>> getIndexedFieldProvider()
        Overrides:
        getIndexedFieldProvider in class org.infinispan.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>>