Package org.hibernate.search.engine
Class DocumentBuilderIndexedEntity<T>
java.lang.Object
org.hibernate.search.engine.AbstractDocumentBuilder<T>
org.hibernate.search.engine.DocumentBuilderIndexedEntity<T>
- All Implemented Interfaces:
DocumentBuilder
Set up and provide a manager for classes which are directly annotated with
@Indexed.-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.search.engine.AbstractDocumentBuilder
AbstractDocumentBuilder.PropertiesMetadata -
Field Summary
Fields inherited from class org.hibernate.search.engine.AbstractDocumentBuilder
beanClass, beanXClassName, containedInCollectionRoles, entityState, fieldCollectionRoles, indexedEmbeddedCollectionRoles, metadata, reflectionManagerFields inherited from interface org.hibernate.search.engine.DocumentBuilder
CLASS_FIELDNAME -
Constructor Summary
ConstructorsConstructorDescriptionDocumentBuilderIndexedEntity(XClass clazz, ConfigContext context, DirectoryProviderFactory.DirectoryProviders providerWrapper, ReflectionManager reflectionManager, Set<XClass> optimizationBlackList) Creates a document builder for entities annotated with@Indexed. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, boolean batch, List<LuceneWork> queue) booleanprotected voidcheckDocumentId(XProperty member, AbstractDocumentBuilder.PropertiesMetadata propertiesMetadata, boolean isRoot, String prefix, ConfigContext context) createAddWork(Class<T> entityClass, T entity, Serializable id, String idInString, EntityInitializer sessionInitializer, boolean isBatch) protected voiddocumentBuilderSpecificChecks(XProperty member, AbstractDocumentBuilder.PropertiesMetadata propertiesMetadata, boolean isRoot, String prefix, ConfigContext context) getDocument(T instance, Serializable id, Map<String, String> fieldToAnalyzerMap, EntityInitializer objectInitializer) Builds the LuceneDocumentfor a given entityinstanceand itsid.Return the id used for indexing if possible An IllegalStateException otherwisegetTerm(Serializable id) objectToString(String fieldName, Object value) Methods inherited from class org.hibernate.search.engine.AbstractDocumentBuilder
addToScopedAnalyzer, appendContainedInWorkForInstance, forceStateInspectionOptimizationsDisabled, getAnalyzer, getAnalyzer, getBeanClass, getBeanXClass, getBoost, getDynamicBoost, getEntityState, getIndex, getMappedSubclasses, getMetadata, getPrecisionStep, getSimilarity, getTermVector, isCollectionRoleExcluded, isDirty, isRoot, postInitialize
-
Constructor Details
-
DocumentBuilderIndexedEntity
public DocumentBuilderIndexedEntity(XClass clazz, ConfigContext context, DirectoryProviderFactory.DirectoryProviders providerWrapper, ReflectionManager reflectionManager, Set<XClass> optimizationBlackList) Creates a document builder for entities annotated with@Indexed.- Parameters:
clazz- The class for which to build aDocumentBuilderContainedEntitycontext- Handle to default configuration settingsproviderWrapper- wrapper for access to directory providers for the underlying Lucene indexesreflectionManager- Reflection manager to use for processing the annotationsoptimizationBlackList- mutable register, keeps track of types on which we need to disable collection events optimizations
-
-
Method Details
-
getIdGetter
-
getIdFieldCacheCollectionFactory
-
documentBuilderSpecificChecks
protected void documentBuilderSpecificChecks(XProperty member, AbstractDocumentBuilder.PropertiesMetadata propertiesMetadata, boolean isRoot, String prefix, ConfigContext context) - Specified by:
documentBuilderSpecificChecksin classAbstractDocumentBuilder<T>
-
checkDocumentId
protected void checkDocumentId(XProperty member, AbstractDocumentBuilder.PropertiesMetadata propertiesMetadata, boolean isRoot, String prefix, ConfigContext context) -
addWorkToQueue
public void addWorkToQueue(Class<T> entityClass, T entity, Serializable id, boolean delete, boolean add, boolean batch, List<LuceneWork> queue) - Specified by:
addWorkToQueuein classAbstractDocumentBuilder<T>
-
createAddWork
public AddLuceneWork createAddWork(Class<T> entityClass, T entity, Serializable id, String idInString, EntityInitializer sessionInitializer, boolean isBatch) -
getDocument
public Document getDocument(T instance, Serializable id, Map<String, String> fieldToAnalyzerMap, EntityInitializer objectInitializer) Builds the LuceneDocumentfor a given entityinstanceand itsid.- Parameters:
instance- The entity for which to build the matching LuceneDocumentid- the entity id.fieldToAnalyzerMap- this maps gets populated while generating theDocument. It allows to specify for any document field a named analyzer to use. This parameter cannot benull.objectInitializer-- Returns:
- The Lucene
Documentfor the specified entity.
-
getIdentifierName
-
getDirectoryProviders
-
getDirectoryProviderSelectionStrategy
-
allowFieldSelectionInProjection
public boolean allowFieldSelectionInProjection() -
getFieldCacheOption
-
getTerm
-
getIdBridge
-
getIdKeywordName
-
getId
Return the id used for indexing if possible An IllegalStateException otherwise If the id is provided, we can't extract it from the entity- Specified by:
getIdin classAbstractDocumentBuilder<T>- Parameters:
entity- The entity for which to return the id. Cannot benull.- Returns:
- entity id
-
objectToString
-
getBridge
-