org.hibernate.search.cfg.impl

## Class SearchConfigurationFromHibernateCore

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

- All Implemented Interfaces:
    SearchConfiguration

      public class SearchConfigurationFromHibernateCore
      extends SearchConfigurationBase
      implements SearchConfiguration

  Search configuration implementation wrapping an Hibernate Core configuration
  Author:
    Emmanuel Bernard

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchConfigurationFromHibernateCore(Metadata metadata, ConfigurationService configurationService, ClassLoaderService hibernateOrmClassLoaderService, BeanResolver hibernateOrmBeanResolver, HibernateSessionFactoryService sessionService, JndiService namingService)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BeanResolver` | `getBeanResolver()`
    `ClassLoaderService` | `getClassLoaderService()`
    `Class<?>` | `getClassMapping(String entityName)` Returns a `Class` from a String parameter.
    `Iterator<Class<?>>` | `getClassMappings()` Returns an iterator over the list of indexed classes
    `InstanceInitializer` | `getInstanceInitializer()` Returns the initializer to be used to initialize potentially lazy entities or collections.
    `SearchMapping` | `getProgrammaticMapping()`
    `Properties` | `getProperties()` Gets properties as a java.util.Properties object.
    `String` | `getProperty(String propertyName)` Gets a configuration property from its name or null if not present
    `Map<Class<? extends Service>,Object>` | `getProvidedServices()` Return the provided services.
    `org.hibernate.annotations.common.reflection.ReflectionManager` | `getReflectionManager()` Returns a reflection manager if already available in the environment null otherwise
    `boolean` | `isIndexMetadataComplete()`
    `boolean` | `isJPAAnnotationsProcessingEnabled()`
    `boolean` | `isMultitenancyEnabled()`

    - ### Methods inherited from class org.hibernate.search.cfg.spi.SearchConfigurationBase

      `isDeleteByTermEnforced, isIdProvidedImplicit, isTransactionManagerExpected`

    - ### 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

      `isDeleteByTermEnforced, isIdProvidedImplicit, isTransactionManagerExpected`

- - ### Constructor Detail

    - #### SearchConfigurationFromHibernateCore

          public SearchConfigurationFromHibernateCore(Metadata metadata,
                                                      ConfigurationService configurationService,
                                                      ClassLoaderService hibernateOrmClassLoaderService,
                                                      BeanResolver hibernateOrmBeanResolver,
                                                      HibernateSessionFactoryService sessionService,
                                                      JndiService namingService)

  - ### Method Detail

    - #### getClassMappings

          public Iterator<Class<?>> getClassMappings()

      Description copied from interface: `SearchConfiguration`
      Returns an iterator over the list of indexed classes
      Specified by:
        `getClassMappings` in interface `SearchConfiguration`
      Returns:
        iterator of indexed classes.

    - #### getClassMapping

          public Class<?> getClassMapping(String entityName)

      Description copied from interface: `SearchConfiguration`
      Returns a `Class` from a String parameter.
      Specified by:
        `getClassMapping` in interface `SearchConfiguration`
      Parameters:
        `entityName` - the class name as string
      Returns:
        corresponding class instance

    - #### getProperty

          public String getProperty(String propertyName)

      Description copied from interface: `SearchConfiguration`
      Gets a configuration property from its name or null if not present
      Specified by:
        `getProperty` in interface `SearchConfiguration`
      Parameters:
        `propertyName` - - as a String.
      Returns:
        the property as a String

    - #### getProperties

          public Properties getProperties()

      Description copied from interface: `SearchConfiguration`
      Gets properties as a java.util.Properties object.
      Specified by:
        `getProperties` in interface `SearchConfiguration`
      Returns:
        a java.util.Properties object.
      See Also:
        `object`

    - #### getReflectionManager

          public org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()

      Description copied from interface: `SearchConfiguration`
      Returns a reflection manager if already available in the environment null otherwise
      Specified by:
        `getReflectionManager` in interface `SearchConfiguration`
      Returns:
        ReflectionManager

    - #### getProgrammaticMapping

          public SearchMapping getProgrammaticMapping()

      Specified by:
        `getProgrammaticMapping` in interface `SearchConfiguration`
      Returns:
        the programmatic configuration or `null`

    - #### getProvidedServices

          public Map<Class<? extends Service>,Object> getProvidedServices()

      Description copied from interface: `SearchConfiguration`
      Return the provided services. These services are passed untouched by Hibernate Search. Provided services have priority over managed services (ie the ones using the service locator pattern).
      Specified by:
        `getProvidedServices` in interface `SearchConfiguration`
      Returns:
        a map of service roles to service instances

    - #### 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`
      Overrides:
        `getInstanceInitializer` in class `SearchConfigurationBase`
      Returns:
        the initializer to be used to initialize potentially lazy entities or collections.

    - #### isIndexMetadataComplete

          public boolean isIndexMetadataComplete()

      Description copied from class: `SearchConfigurationBase`

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

      Specified by:
        `isIndexMetadataComplete` in interface `SearchConfiguration`
      Overrides:
        `isIndexMetadataComplete` in class `SearchConfigurationBase`
      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.

    - #### isMultitenancyEnabled

          public boolean isMultitenancyEnabled()

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

    - #### getClassLoaderService

          public ClassLoaderService getClassLoaderService()

      Specified by:
        `getClassLoaderService` in interface `SearchConfiguration`
      Returns:
        a classloader service for this configuration of Search. Access to the service is via the `ServiceManager.getClassLoaderService()`

    - #### getBeanResolver

          public BeanResolver getBeanResolver()

      Specified by:
        `getBeanResolver` in interface `SearchConfiguration`
      Returns:
        a bean resolver for this configuration of Search, or `null` to use the default one. Access to the service is via the `ServiceManager.getBeanResolver()`

    - #### isJPAAnnotationsProcessingEnabled

          public boolean isJPAAnnotationsProcessingEnabled()

      Specified by:
        `isJPAAnnotationsProcessingEnabled` in interface `SearchConfiguration`
      Overrides:
        `isJPAAnnotationsProcessingEnabled` in class `SearchConfigurationBase`
      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