Hibernate version: 3
Mapping documents: using annonations
A question on the @Lob annotation.
I am using the @Lob annotation on a byte variable in my POJO.
The Java Persistence with Hibernate nook by C Bauer & G King state that this annotation provides lazy loading by definition without the need for interception.
However, when i look at the tomcat log I can still see the blob being fetched, not to mention the performance of my application ;)
code:
@Entity
public class File{
@Lob
@Basic (fetch = FetchType.LAZY) // don't think this should be necessary
private byte[] content;
.....
}
This File class is then contained in another POJO with an association where the fetchType is set to EAGER.
@Entity
public class Climas{
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(...)
private Set<File> file;
}
Does this EAGER fetch override the lazy @Lob or am i doing something else wrong?
I have read on a number of forums that i need to instrument the code for this to work but the book doesn't seem to agree & thus i am a bit confused ..
Cheers in advance
|