I’m trying to avoid hibernate’s lazy-loading mechanism and I’ve created this list object with the Eager FetchType, which I would suppose would do it:
@JsonIgnore
@CollectionTable(name = "nav", joinColumns = @JoinColumn(name="conn"))
@ElementCollection(fetch = FetchType.EAGER)
@IndexColumn(name="filter") private List<String> filters = Lists.newArrayList();
But I’m still reading a PersistentList, instead of java.util.List. Any idea on what may be wrong ?
I’m not using xml configurations.
To avoid lazy loading you have to set
lazy = trueand instead ofFetchType.EAGERmake itFetchType.JOIN.for annotations based mapping refer to the below link:
[http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#entity-hibspec-singleassoc-fetching]
let me know if it helps you.