Open
Description
There should be an option to assume that all ManyToX
and OneToX
annotation markers are lazy
to avoid the issue where there are times an EAGER collection will be a PersistentCollection.
For example, like so:
protected boolean usesLazyLoading(BeanProperty property) {
if (property != null) {
boolean assumeLazy = Feature.ASSUME_ANY_MARKER_IS_LAZY.enabledIn(_features)
// As per [Issue#36]
ElementCollection ec = property.getAnnotation(ElementCollection.class);
if (ec != null) {
return assumeLazy || (ec.fetch() == FetchType.LAZY);
}
OneToMany ann1 = property.getAnnotation(OneToMany.class);
if (ann1 != null) {
return assumeLazy || (ann1.fetch() == FetchType.LAZY);
}
OneToOne ann2 = property.getAnnotation(OneToOne.class);
if (ann2 != null) {
return assumeLazy || (ann2.fetch() == FetchType.LAZY);
}
ManyToOne ann3 = property.getAnnotation(ManyToOne.class);
if (ann3 != null) {
return assumeLazy || (ann3.fetch() == FetchType.LAZY);
}
ManyToMany ann4 = property.getAnnotation(ManyToMany.class);
if (ann4 != null) {
return assumeLazy || (ann4.fetch() == FetchType.LAZY);
}
// As per [Issue#53]
return !Feature.REQUIRE_EXPLICIT_LAZY_LOADING_MARKER.enabledIn(_features);
}
return false;
}
Metadata
Metadata
Assignees
Labels
No labels