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
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
Modifier and TypeMethodDescriptionvoidTo be called internally by the session, forcing immediate initialization.booleanIs this instance initialized?
-
Method Details
-
wasInitialized
boolean wasInitialized()Is this instance initialized?- Returns:
- Was this collection initialized? Or is its data still not (fully) loaded?
- See Also:
-
forceInitialization
void forceInitialization()To be called internally by the session, forcing immediate initialization.- See Also:
-