Package org.hibernate.annotations
Annotation Interface LazyCollection
@Deprecated(since="6.2")
@Target({METHOD,FIELD})
@Retention(RUNTIME)
public @interface LazyCollection
Deprecated.
Specify the laziness of a collection, either a
OneToMany
or
ManyToMany
association,
or an ElementCollection
.
This is an alternative to specifying the JPA
FetchType
. This annotation
is used to enable extra-lazy collection fetching.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDeprecated.The laziness of the collection.
-
Element Details
-
value
LazyCollectionOption valueDeprecated.The laziness of the collection.- Default:
- TRUE
-
FetchType.EAGER
instead ofLazyCollection(FALSE)
.Hibernate
, for exampleHibernate.size(Collection)
,Hibernate.contains(Collection, Object)
, orHibernate.get(Map, Object)
instead ofLazyCollection(EXTRA)
.