org.hibernate.search.orm.loading.impl

## Class HibernateStatelessInitializer

- java.lang.Object
- - org.hibernate.search.orm.loading.impl.HibernateStatelessInitializer

- All Implemented Interfaces:
    InstanceInitializer
  Direct Known Subclasses:
    HibernateSessionLoadingInitializer

      public class HibernateStatelessInitializer
      extends Object
      implements InstanceInitializer

  To be used for Hibernate initializations which don't need a specific Session. `initializeCollection(Collection)` and `initializeMap(Map)` are not supported.
  Author:
    Sanne Grinovero (C) 2011 Red Hat Inc.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static HibernateStatelessInitializer` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `HibernateStatelessInitializer()`

  - ### Method Summary

    All Methods Instance Methods Concrete 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 instance)`

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

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

- - ### Field Detail

    - #### INSTANCE

          public static final HibernateStatelessInitializer INSTANCE

  - ### Constructor Detail

    - #### HibernateStatelessInitializer

          protected HibernateStatelessInitializer()

  - ### Method Detail

    - #### getClass

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

      Specified by:
        `getClass` in interface `InstanceInitializer`
      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

          public Object unproxy(Object instance)

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

    - #### initializeCollection

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

      Specified by:
        `initializeCollection` in interface `InstanceInitializer`
      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

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

      Specified by:
        `initializeMap` in interface `InstanceInitializer`
      Type Parameters:
        `K` - key
        `V` - value
      Parameters:
        `value` - the map to initialize
      Returns:
        the initialized Map, to be used on lazily-loading maps

    - #### initializeArray

          public Object[] initializeArray(Object[] value)

      Specified by:
        `initializeArray` in interface `InstanceInitializer`
      Parameters:
        `value` - the array to initialize
      Returns:
        the initialized array, to be used on lazily-loading arrays

    - #### getIndexedTypeIdFromWork

          public IndexedTypeIdentifier getIndexedTypeIdFromWork(Work work)

      Specified by:
        `getIndexedTypeIdFromWork` in interface `InstanceInitializer`
      Returns:
        the identification of the user type being indexed

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