Class HibernateSearchPropertyHelper
- java.lang.Object
-
- org.infinispan.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>>
-
- org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
-
- org.infinispan.query.dsl.embedded.impl.HibernateSearchPropertyHelper
-
public final class HibernateSearchPropertyHelper extends org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelperUses 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 Summary
Constructors Constructor Description HibernateSearchPropertyHelper(org.hibernate.search.spi.SearchIntegrator searchFactory, org.infinispan.objectfilter.impl.syntax.parser.EntityNameResolver<Class<?>> entityNameResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertToPropertyType(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.LuceneQueryMaker.FieldBridgeAndAnalyzerProvider<Class<?>>getDefaultFieldBridgeProvider()org.infinispan.objectfilter.impl.syntax.IndexedFieldProvider<Class<?>>getIndexedFieldProvider()Class<?>getPrimitivePropertyType(Class<?> entityType, String[] propertyPath)booleanhasEmbeddedProperty(Class<?> entityType, String[] propertyPath)Determines whether the given property path denotes an embedded entity (not a property of such entity).booleanhasProperty(Class<?> entityType, String[] propertyPath)booleanisRepeatedProperty(Class<?> entityType, String[] propertyPath)List<?>mapPropertyNamePathToFieldIdPath(Class<?> entityType, String[] propertyPath)-
Methods inherited from class org.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
getEntityMetadata
-
-
-
-
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:
mapPropertyNamePathToFieldIdPathin classorg.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:
convertToPropertyTypein classorg.infinispan.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>>- Parameters:
value- the value to convertentityType- the type hosting the propertypropertyPath- 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:
getPrimitivePropertyTypein classorg.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
-
isRepeatedProperty
public boolean isRepeatedProperty(Class<?> entityType, String[] propertyPath)
- Overrides:
isRepeatedPropertyin classorg.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper
-
getDefaultFieldBridgeProvider
public LuceneQueryMaker.FieldBridgeAndAnalyzerProvider<Class<?>> getDefaultFieldBridgeProvider()
-
hasProperty
public boolean hasProperty(Class<?> entityType, String[] propertyPath)
- Overrides:
hasPropertyin classorg.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:
hasEmbeddedPropertyin classorg.infinispan.objectfilter.impl.syntax.parser.ReflectionPropertyHelper- Parameters:
entityType- the indexed typepropertyPath- the path of interest- Returns:
trueif the given path denotes an embedded entity of the given indexed type,falseotherwise.
-
-