For previous references to my problem, check
http://forum.hibernate.org/viewtopic.php?t=959478
I would really like to be able to have multiple sets declared to be fetched EAGERly in my POJOs, but whatever combination of annotations I use that would specify a non-lazy fetch, I keep getting the "cannot simultaneously fetch multiple bags" error. I do not wish to leave the sessions open, and I have made sure that there are sufficient unidirectional associations so that I don't wind up loading the "whole database" in a single POJO.
I really was depending on the @OneToMany and @ManyToMany EAGER fetching. All of my collections are defined as SortedSet or Lists with an @IndexColumn, and so, by definition, are not Bags, according to the documentation.
I have tried @Fetch(FetchMode.JOIN) and I have tried @LazyCollection(LazyCollectionOption.FALSE). Is there any working way to declare these collections not lazy? There must be a way around this issue, yes? I haven't been able to find an answer on the forum for two days, and none of my investigations have been very useful.
I believe that there may be an issue with this method found in org.hibernate.loader.BasicLoader.java:
Code:
private boolean isBag(CollectionPersister collectionPersister) {
return collectionPersister.getCollectionType().getClass().isAssignableFrom( BagType.class );
}
Why would a BagType be assignable to a SortedSet? A Set should never be considered a Bag, yes? Something's off here, and my window is about to close on my project. Can someone help? Perhaps provide me with the annotations necessary to load these collections non-lazy?
Thanks.
Tom Harris