Package org.hibernate.search.engine.spi
Interface EntityInitializer
- All Known Implementing Classes:
HibernateSessionLoadingInitializer,HibernateStatelessInitializer
public interface EntityInitializer
Used to deal with proxies or lazily-initialized objects.
-
Method Summary
Modifier and TypeMethodDescription<T> Class<T> getClass(T entity) Object[]initializeArray(Object[] value) <T> Collection<T> initializeCollection(Collection<T> value) <K,V> Map <K, V> initializeMap(Map<K, V> value)
-
Method Details
-
getClass
- Type Parameters:
T-- Parameters:
entity- an instance or proxy of T- Returns:
- the class from the instance, or the underlying class from a proxy.
-
unproxy
- Parameters:
value-- Returns:
- if value is a proxy, unwraps it, otherwise works as a pass-through function.
-
initializeCollection
- Type Parameters:
T-- Parameters:
value-- Returns:
- the initialized Collection, to be used on lazily-loading collections
-
initializeMap
- Type Parameters:
T-- Parameters:
value-- Returns:
- the initialized Map, to be used on lazily-loading maps
-
initializeArray
- Type Parameters:
T-- Parameters:
value-- Returns:
- the initialized array, to be used on lazily-loading arrays
-