org.hibernate.search.cfg.spi

## Class SearchConfigurationBase

- java.lang.Object
- - org.hibernate.search.cfg.spi.SearchConfigurationBase

- All Implemented Interfaces:
    SearchConfiguration
  Direct Known Subclasses:
    IncrementalSearchConfiguration, SearchConfigurationFromHibernateCore

      public abstract class SearchConfigurationBase
      extends Object
      implements SearchConfiguration

  Suggested base class to create custom SearchConfiguration implementations. We might need to add new methods to the `SearchConfiguration` interface, in that case we can add default implementations here to avoid breaking integration code.
  Author:
    Sanne Grinovero (C) 2012 Red Hat Inc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchConfigurationBase()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InstanceInitializer` | `getInstanceInitializer()` Returns the initializer to be used to initialize potentially lazy entities or collections.
    `boolean` | `isDeleteByTermEnforced()`
    `boolean` | `isIdProvidedImplicit()`
    `boolean` | `isIndexMetadataComplete()`
    `boolean` | `isJPAAnnotationsProcessingEnabled()`
    `boolean` | `isMultitenancyEnabled()`
    `boolean` | `isTransactionManagerExpected()` By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.

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

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

    - ### Methods inherited from interface org.hibernate.search.cfg.spi.SearchConfiguration

      `getBeanResolver, getClassLoaderService, getClassMapping, getClassMappings, getProgrammaticMapping, getProperties, getProperty, getProvidedServices, getReflectionManager`

- - ### Constructor Detail

    - #### SearchConfigurationBase

          public SearchConfigurationBase()

  - ### Method Detail

    - #### isTransactionManagerExpected

          public boolean isTransactionManagerExpected()

      By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.

      In most cases it is safest to default to `true`.

      Specified by:
        `isTransactionManagerExpected` in interface `SearchConfiguration`
      Returns:
        when returning `false` Search will avoid logging such warnings.

    - #### isIndexMetadataComplete

          public boolean isIndexMetadataComplete()

      In most cases it is safest to default to `false`.

      Specified by:
        `isIndexMetadataComplete` in interface `SearchConfiguration`
      Returns:
        `true` if it is safe to assume that the information we have about index metadata is accurate. This should be set to false for example if the index could contain Documents related to types not known to this SearchFactory instance.

    - #### isDeleteByTermEnforced

          public boolean isDeleteByTermEnforced()

      Specified by:
        `isDeleteByTermEnforced` in interface `SearchConfiguration`
      Returns:
        `true` if regardless of `isIndexMetadataComplete` and the number of types present in the index it is safe to delete by term given that the underlying store guarantees uniqueness of ids

    - #### getInstanceInitializer

          public InstanceInitializer getInstanceInitializer()

      Description copied from interface: `SearchConfiguration`
      Returns the initializer to be used to initialize potentially lazy entities or collections.
      Specified by:
        `getInstanceInitializer` in interface `SearchConfiguration`
      Returns:
        the initializer to be used to initialize potentially lazy entities or collections.

    - #### isIdProvidedImplicit

          public boolean isIdProvidedImplicit()

      Specified by:
        `isIdProvidedImplicit` in interface `SearchConfiguration`
      Returns:
        `true` if we should treat indexed entities as implicitly annotated with a `ProvidedId`, if no other Id is specified.

    - #### isMultitenancyEnabled

          public boolean isMultitenancyEnabled()

      Specified by:
        `isMultitenancyEnabled` in interface `SearchConfiguration`
      Returns:
        `true` if `multitenancy` should be enabled. When in doubt, this should return `true`.

    - #### isJPAAnnotationsProcessingEnabled

          public boolean isJPAAnnotationsProcessingEnabled()

      Specified by:
        `isJPAAnnotationsProcessingEnabled` in interface `SearchConfiguration`
      Returns:
        `true` if the Hibernate Search mapping should look for JPA annotations to affect the mapping. Disable this if the JPA API is not available, or to ignore them. Ignoring them implies to ignore, among others, the javax.persistence.Id annotation, which implies the primary identifiers will require explicit mapping over the "provided id" mechanism or the use of `DocumentId`.

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