org.hibernate.search.spi

## Interface InstanceInitializer

- All Known Implementing Classes:
    HibernateSessionLoadingInitializer, HibernateStatelessInitializer, SimpleInitializer

      public interface InstanceInitializer

  When using the Hibernate Core integration (for example) we need to make sure that the entities and collections we're working on are initialized. Initialization strategies might vary according to the integrating framework; when integrating with Infinispan (as Infinispan Query) no initialization is needed.
  Author:
    Sanne Grinovero (C) 2011 Red Hat Inc.
  See Also:
    `SimpleInitializer`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> Class<T>` | `getClass(T entity)`
    `IndexedTypeIdentifier` | `getIndexedTypeIdFromWork(Work work)`
    `Object[]` | `initializeArray(Object[] value)`
    `<T> Collection<T>` | `initializeCollection(Collection<T> value)`
    `<K,V> Map<K,V>` | `initializeMap(Map<K,V> value)`
    `Object` | `unproxy(Object value)`

- - ### Method Detail

    - #### getClass

          <T> Class<T> getClass(T entity)

      Type Parameters:
        `T` - the type of the entity
      Parameters:
        `entity` - an instance or proxy of T
      Returns:
        the class from the instance, or the underlying class from a proxy.

    - #### unproxy

          Object unproxy(Object value)

      Parameters:
        `value` - the object to unproxy
      Returns:
        if value is a proxy, unwraps it, otherwise works as a pass-through function.

    - #### initializeCollection

          <T> Collection<T> initializeCollection(Collection<T> value)

      Type Parameters:
        `T` - the type of the elements in the collection
      Parameters:
        `value` - the collection to initialize
      Returns:
        the initialized Collection, to be used on lazily-loading collections

    - #### initializeMap

          <K,V> Map<K,V> initializeMap(Map<K,V> value)

      Type Parameters:
        `K` - key
        `V` - value
      Parameters:
        `value` - the map to initialize
      Returns:
        the initialized Map, to be used on lazily-loading maps

    - #### initializeArray

          Object[] initializeArray(Object[] value)

      Parameters:
        `value` - the array to initialize
      Returns:
        the initialized array, to be used on lazily-loading arrays

    - #### getIndexedTypeIdFromWork

          IndexedTypeIdentifier getIndexedTypeIdFromWork(Work work)

      Parameters:
        `work` -
      Returns:
        the identification of the user type being indexed

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