org.hibernate.search.orm.loading.impl

## Class HibernateSessionLoadingInitializer

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

- All Implemented Interfaces:
    InstanceInitializer

      public class HibernateSessionLoadingInitializer
      extends HibernateStatelessInitializer
      implements InstanceInitializer

  This EntityInitializer is relative to a specific Hibernate Session, so it's able to attach detached collections to it's Session.
  Author:
    Sanne Grinovero (C) 2011 Red Hat Inc.

- - ### Field Summary

    - ### Fields inherited from class org.hibernate.search.orm.loading.impl.HibernateStatelessInitializer

      `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HibernateSessionLoadingInitializer(SessionImplementor hibernateSession)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<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 org.hibernate.search.orm.loading.impl.HibernateStatelessInitializer

      `getClass, getIndexedTypeIdFromWork, initializeArray`

    - ### 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.spi.InstanceInitializer

      `getClass, getIndexedTypeIdFromWork, initializeArray`

- - ### Constructor Detail

    - #### HibernateSessionLoadingInitializer

          public HibernateSessionLoadingInitializer(SessionImplementor hibernateSession)

  - ### Method Detail

    - #### unproxy

          public Object unproxy(Object instance)

      Specified by:
        `unproxy` in interface `InstanceInitializer`
      Overrides:
        `unproxy` in class `HibernateStatelessInitializer`
      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`
      Overrides:
        `initializeCollection` in class `HibernateStatelessInitializer`
      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`
      Overrides:
        `initializeMap` in class `HibernateStatelessInitializer`
      Type Parameters:
        `K` - key
        `V` - value
      Parameters:
        `value` - the map to initialize
      Returns:
        the initialized Map, to be used on lazily-loading maps

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