Package org.hibernate.collection.spi
Interface LazyInitializable
-
- All Known Subinterfaces:
PersistentCollection<E>
- All Known Implementing Classes:
AbstractPersistentCollection,CollectionProxy,ListProxy,MapProxy,PersistentArrayHolder,PersistentBag,PersistentIdentifierBag,PersistentList,PersistentMap,PersistentSet,PersistentSortedMap,PersistentSortedSet,SetProxy,SortedMapProxy,SortedSetProxy
@Incubating public interface LazyInitializable
The most general abstraction over collections which may be fetched lazily.- Hibernate core "wraps" a Java collection in an instance of
PersistentCollection. - Similarly, Envers uses its own custom collection wrappers:
ListProxy,SetProxy, and friends).
All of these wrapper objects extend
LazyInitializable, allowing:- the method
Hibernate.isInitialized(Object)to determine if the collection was already fetched, and - the method
Hibernate.initialize(Object)to force it to be fetched.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidforceInitialization()To be called internally by the session, forcing immediate initialization.booleanwasInitialized()Is this instance initialized?
-
-
-
Method Detail
-
wasInitialized
boolean wasInitialized()
Is this instance initialized?- Returns:
- Was this collection initialized? Or is its data still not (fully) loaded?
- See Also:
Hibernate.isInitialized(Object)
-
forceInitialization
void forceInitialization()
To be called internally by the session, forcing immediate initialization.- See Also:
Hibernate.initialize(Object)
-
-