public abstract class AbstractDocumentBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected EntityState |
entityState |
Constructor and Description |
---|
AbstractDocumentBuilder(org.hibernate.annotations.common.reflection.XClass xClass,
TypeMetadata typeMetadata,
org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager,
Set<org.hibernate.annotations.common.reflection.XClass> optimizationBlackList,
InstanceInitializer instanceInitializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addWorkToQueue(String tenantIdentifier,
Class<?> entityClass,
Object entity,
Serializable id,
boolean delete,
boolean add,
List<LuceneWork> queue,
ConversionContext contextualBridge) |
void |
appendContainedInWorkForInstance(Object instance,
WorkPlan workPlan,
ContainedInRecursionContext currentRecursionContext)
If we have a work instance we have to check whether the instance to be indexed is contained in any other indexed entities.
|
void |
appendContainedInWorkForInstance(Object instance,
WorkPlan workPlan,
ContainedInRecursionContext currentRecursionContext,
String tenantIdentifier)
If we have a work instance we have to check whether the instance to be indexed is contained in any other indexed entities for a tenant.
|
void |
close()
Closes any resource
|
boolean |
collectionChangeRequiresIndexUpdate(String collectionRoleName)
Returns
true if the collection event is going to affect the index state. |
void |
forceStateInspectionOptimizationsDisabled()
Makes sure isCollectionRoleExcluded will always return false, so that
collection update events are always processed.
|
ScopedAnalyzerReference |
getAnalyzerReference() |
Class<?> |
getBeanClass() |
org.hibernate.annotations.common.reflection.XClass |
getBeanXClass() |
EntityState |
getEntityState() |
abstract Serializable |
getId(Object entity)
In case of an indexed entity, return the value of it's identifier: what is marked as @Id or @DocumentId;
in case the entity uses @ProvidedId, it's illegal to call this method.
|
protected InstanceInitializer |
getInstanceInitializer() |
Set<Class<?>> |
getMappedSubclasses() |
TypeMetadata |
getMetadata() |
TypeMetadata |
getTypeMetadata() |
boolean |
isDirty(String[] dirtyPropertyNames)
Hibernate entities might be dirty (their state has changed), but none of these changes would affect
the index state.
|
boolean |
isIdMatchingJpaId()
To be removed, see org.hibernate.search.engine.DocumentBuilderIndexedEntity.isIdMatchingJpaId()
|
boolean |
isRoot() |
void |
postInitialize(Set<Class<?>> indexedClasses) |
boolean |
requiresProvidedId()
To be removed, see org.hibernate.search.engine.DocumentBuilderIndexedEntity.isIdMatchingJpaId()
|
String |
toString() |
protected EntityState entityState
public AbstractDocumentBuilder(org.hibernate.annotations.common.reflection.XClass xClass, TypeMetadata typeMetadata, org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager, Set<org.hibernate.annotations.common.reflection.XClass> optimizationBlackList, InstanceInitializer instanceInitializer)
xClass
- The class for which to build a document buildertypeMetadata
- metadata for the specified classreflectionManager
- Reflection manager to use for processing the annotationsoptimizationBlackList
- keeps track of types on which we need to disable collection events optimizationsinstanceInitializer
- a InstanceInitializer
object.public abstract void addWorkToQueue(String tenantIdentifier, Class<?> entityClass, Object entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge)
public abstract Serializable getId(Object entity)
entity
- the instance for which to retrieve the idIllegalStateException
- when used with a @ProvidedId annotated entitypublic TypeMetadata getTypeMetadata()
public boolean isRoot()
public Class<?> getBeanClass()
public org.hibernate.annotations.common.reflection.XClass getBeanXClass()
public TypeMetadata getMetadata()
public ScopedAnalyzerReference getAnalyzerReference()
public EntityState getEntityState()
public void appendContainedInWorkForInstance(Object instance, WorkPlan workPlan, ContainedInRecursionContext currentRecursionContext)
instance
- the instance to be indexedworkPlan
- the current work plancurrentRecursionContext
- the current ContainedInRecursionContext
object used to check the graph traversalappendContainedInWorkForInstance(Object, WorkPlan, ContainedInRecursionContext, String)
public void appendContainedInWorkForInstance(Object instance, WorkPlan workPlan, ContainedInRecursionContext currentRecursionContext, String tenantIdentifier)
instance
- the instance to be indexedworkPlan
- the current work plancurrentRecursionContext
- the current ContainedInRecursionContext
object used to check the graph traversaltenantIdentifier
- the identifier of the tenant or null, if there isn't oneappendContainedInWorkForInstance(Object, WorkPlan, ContainedInRecursionContext)
protected InstanceInitializer getInstanceInitializer()
public boolean isDirty(String[] dirtyPropertyNames)
true
if any of changed entity properties identified
by their names (dirtyPropertyNames
) will effect the index state.dirtyPropertyNames
- array of property names for the changed entity properties, null
in case the
changed properties cannot be specified.true
if the entity changes will effect the index state, false
otherwisepublic boolean requiresProvidedId()
public boolean isIdMatchingJpaId()
public boolean collectionChangeRequiresIndexUpdate(String collectionRoleName)
true
if the collection event is going to affect the index state. In this case
the indexing event can be ignored. false
otherwise.collectionRoleName
- a String
object.true
if an update to the collection identified by the given role name effects the index
state, false
otherwise.public void forceStateInspectionOptimizationsDisabled()
public void close()
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved