org.hibernate.search.engine.spi

## Class DocumentBuilderContainedEntity

- java.lang.Object
- - org.hibernate.search.engine.spi.AbstractDocumentBuilder
  - - org.hibernate.search.engine.spi.DocumentBuilderContainedEntity

-     public class DocumentBuilderContainedEntity
      extends AbstractDocumentBuilder

  Set up and provide a manager for classes which are indexed via `@IndexedEmbedded`, but themselves do not contain the `@Indexed` annotation.
  Author:
    Gavin King, Emmanuel Bernard, Sylvain Vieujot, Richard Hallier, Hardy Ferentschik

- - ### Field Summary

    - ### Fields inherited from class org.hibernate.search.engine.spi.AbstractDocumentBuilder

      `entityState`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentBuilderContainedEntity(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 used on contained entities not annotated with `@Indexed` themselves.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addWorkToQueue(String tenantId, IndexedTypeIdentifier typeIdentifier, Object entity, Serializable id, boolean delete, boolean add, List<LuceneWork> queue, ConversionContext contextualBridge)`
    `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.

    - ### Methods inherited from class org.hibernate.search.engine.spi.AbstractDocumentBuilder

      `appendContainedInWorkForInstance, appendContainedInWorkForInstance, collectionChangeRequiresIndexUpdate, forceStateInspectionOptimizationsDisabled, getAnalyzerReference, getEntityState, getInstanceInitializer, getMappedSubclasses, getTypeMetadata, isDirty, isIdMatchingJpaId, isRoot, postInitialize, requiresProvidedId, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DocumentBuilderContainedEntity

          public DocumentBuilderContainedEntity(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 used on contained entities not annotated with `@Indexed` themselves.
      Parameters:
        `xClass` - The class for which to build a `DocumentBuilderContainedEntity`
        `typeMetadata` - metadata for the given type
        `reflectionManager` - Reflection manager to use for processing the annotations
        `optimizationBlackList` - mutable register, keeps track of types on which we need to disable collection events optimizations
        `instanceInitializer` - a `InstanceInitializer` object

  - ### Method Detail

    - #### addWorkToQueue

          public void addWorkToQueue(String tenantId,
                                     IndexedTypeIdentifier typeIdentifier,
                                     Object entity,
                                     Serializable id,
                                     boolean delete,
                                     boolean add,
                                     List<LuceneWork> queue,
                                     ConversionContext contextualBridge)

      Specified by:
        `addWorkToQueue` in class `AbstractDocumentBuilder`

    - #### getId

          public Serializable getId(Object entity)

      Description copied from class: `AbstractDocumentBuilder`
      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.
      Specified by:
        `getId` in class `AbstractDocumentBuilder`
      Parameters:
        `entity` - the instance for which to retrieve the id
      Returns:
        the value, or null if it's not an indexed entity

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved