public abstract class AbstractDocumentBuilder<T> 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(Class<T> entityClass,
T entity,
Serializable id,
boolean delete,
boolean add,
List<LuceneWork> queue,
ConversionContext contextualBridge) |
void |
appendContainedInWorkForInstance(Object instance,
WorkPlan workPlan,
DepthValidator currentDepth)
If we have a work instance we have to check whether the instance to be indexed is contained in any other indexed entities.
|
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.
|
ScopedAnalyzer |
getAnalyzer() |
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 |
isCollectionRoleExcluded(String collectionRole)
Deprecated.
Use
collectionChangeRequiresIndexUpdate(String) instead |
boolean |
isDirty(String[] dirtyPropertyNames)
Hibernate entities might be dirty (their state has changed), but none of these changes would effect
the 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(Class<T> entityClass, T 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 ScopedAnalyzer getAnalyzer()
public EntityState getEntityState()
public void appendContainedInWorkForInstance(Object instance, WorkPlan workPlan, DepthValidator currentDepth)
instance
- the instance to be indexedworkPlan
- the current work plancurrentDepth
- the current DepthValidator
object used to check the graph traversalprotected 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 boolean isCollectionRoleExcluded(String collectionRole)
collectionChangeRequiresIndexUpdate(String)
insteadpublic void forceStateInspectionOptimizationsDisabled()
isCollectionRoleExcluded(String)
public void close()
Copyright © 2006-2014 Red Hat, Inc. All Rights Reserved