public class DocumentBuilderIndexedEntity extends AbstractDocumentBuilder
@Indexed
.Modifier and Type | Field and Description |
---|---|
static String |
TENANT_ID_FIELDNAME
The tenant identifier.
|
entityState
Constructor and Description |
---|
DocumentBuilderIndexedEntity(org.hibernate.annotations.common.reflection.XClass clazz,
TypeMetadata typeMetadata,
ConfigContext context,
org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager,
Set<org.hibernate.annotations.common.reflection.XClass> optimizationBlackList,
InstanceInitializer instanceInitializer)
Creates a document builder for entities annotated with
@Indexed . |
Modifier and Type | Method and Description |
---|---|
void |
addWorkToQueue(String tenantId,
Class<?> entityClass,
Object entity,
Serializable id,
boolean delete,
boolean add,
List<LuceneWork> queue,
ConversionContext contextualBridge) |
boolean |
allowFieldSelectionInProjection() |
AddLuceneWork |
createAddWork(String tenantId,
Class<?> entityClass,
Object entity,
Serializable id,
String idInString,
InstanceInitializer sessionInitializer,
ConversionContext conversionContext) |
UpdateLuceneWork |
createUpdateWork(String tenantId,
Class entityClass,
Object entity,
Serializable id,
String idInString,
InstanceInitializer sessionInitializer,
ConversionContext contextualBridge) |
FieldBridge |
getBridge(String fieldName) |
Document |
getDocument(String tenantId,
Object instance,
Serializable id,
Map<String,String> fieldToAnalyzerMap,
InstanceInitializer objectInitializer,
ConversionContext conversionContext,
String[] includedFieldNames)
Builds the Lucene
Document for a given entity instance and its id. |
Set<FieldCacheType> |
getFieldCacheOption()
Deprecated.
|
Serializable |
getId(Object entity)
Return the id used for indexing if possible
An IllegalStateException otherwise
|
TwoWayFieldBridge |
getIdBridge() |
String |
getIdentifierName() |
org.hibernate.annotations.common.reflection.XMember |
getIdGetter() |
String |
getIdKeywordName() |
boolean |
isIdMatchingJpaId()
FIXME remove the need for such a method, we should always be able to rely on Work.id,
but to respect @DocumentId which is being processed in the DocumentBuilder currently
finding out which id we need is tricky, and requires helpers method like this one.
|
String |
objectToString(String fieldName,
FieldBridge bridge,
Object value,
ConversionContext conversionContext) |
String |
objectToString(String fieldName,
Object value,
ConversionContext conversionContext) |
boolean |
requiresProvidedId()
To be removed, see org.hibernate.search.engine.DocumentBuilderIndexedEntity.isIdMatchingJpaId()
|
appendContainedInWorkForInstance, appendContainedInWorkForInstance, close, collectionChangeRequiresIndexUpdate, forceStateInspectionOptimizationsDisabled, getAnalyzer, getBeanClass, getBeanXClass, getEntityState, getInstanceInitializer, getMappedSubclasses, getMetadata, getTypeMetadata, isDirty, isRoot, postInitialize, toString
public static final String TENANT_ID_FIELDNAME
public DocumentBuilderIndexedEntity(org.hibernate.annotations.common.reflection.XClass clazz, TypeMetadata typeMetadata, ConfigContext context, org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager, Set<org.hibernate.annotations.common.reflection.XClass> optimizationBlackList, InstanceInitializer instanceInitializer)
@Indexed
.clazz
- The class for which to build a DocumentBuilderContainedEntity
typeMetadata
- all the metadata for the entity typecontext
- Handle to default configuration settingsreflectionManager
- Reflection manager to use for processing the annotationsoptimizationBlackList
- mutable register, keeps track of types on which we need to disable collection events optimizationsinstanceInitializer
- helper class for class object graph navigationpublic org.hibernate.annotations.common.reflection.XMember getIdGetter()
public void addWorkToQueue(String tenantId, Class<?> entityClass, Object entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge)
addWorkToQueue
in class AbstractDocumentBuilder
public AddLuceneWork createAddWork(String tenantId, Class<?> entityClass, Object entity, Serializable id, String idInString, InstanceInitializer sessionInitializer, ConversionContext conversionContext)
public UpdateLuceneWork createUpdateWork(String tenantId, Class entityClass, Object entity, Serializable id, String idInString, InstanceInitializer sessionInitializer, ConversionContext contextualBridge)
public Document getDocument(String tenantId, Object instance, Serializable id, Map<String,String> fieldToAnalyzerMap, InstanceInitializer objectInitializer, ConversionContext conversionContext, String[] includedFieldNames)
Document
for a given entity instance and its id.tenantId
- the identifier of the tenant or null if there isn't oneinstance
- The entity for which to build the matching Lucene Document
id
- the entity id.fieldToAnalyzerMap
- this maps gets populated while generating the Document
.
It allows to specify for any document field a named analyzer to use. This parameter cannot be null
.objectInitializer
- used to ensure that all objects are initializedconversionContext
- a ConversionContext
object.includedFieldNames
- list of field names to consider. Others can be excluded. Null if all fields are considered.Document
for the specified entity.public String getIdentifierName()
public boolean allowFieldSelectionInProjection()
@Deprecated public Set<FieldCacheType> getFieldCacheOption()
public TwoWayFieldBridge getIdBridge()
public String getIdKeywordName()
public Serializable getId(Object entity)
If the id is provided, we can't extract it from the entity
getId
in class AbstractDocumentBuilder
entity
- the instance for which to retrieve the idpublic String objectToString(String fieldName, Object value, ConversionContext conversionContext)
public String objectToString(String fieldName, FieldBridge bridge, Object value, ConversionContext conversionContext)
public FieldBridge getBridge(String fieldName)
public boolean requiresProvidedId()
requiresProvidedId
in class AbstractDocumentBuilder
public boolean isIdMatchingJpaId()
isIdMatchingJpaId
in class AbstractDocumentBuilder
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved