Hey guys,
I have the following relationship: 1 IFormsMetaData to many Info objects. This collection will in the future reach into the 10s of thousands of objects so I need to ensure that when adding to the collection, hibernate doesn't load the whole lot (as happens at the moment)
I am using hibernate 3.2.6 with hsqldb 1.8.0.8 with Spring 2.0.8
IFormsMeta Entity code:
Code:
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifm")
@ContainedIn
@Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
public Set<Info> getIforms() {
if(iforms == null) iforms = new HashSet<Info>();
return iforms;
}
Info Entity code:
Code:
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.REMOVE}, fetch = FetchType.EAGER)
@IndexedEmbedded (depth = 5)
public IFormMetaData getIfm() {
return ifm;
}
I've had a look at Extra lazy fetching for collections but it doesn't seem to solve the problem....
Any pointers appreciated as despite a lot of searching I've been unable to locate a satisfactory solution to this problem.
Cheers