I have a byte[] in an entity that I am annotating with lob and fetch=lazy. Yet when I retrieve it though a session bean, the lob is fully loaded. I've heard that "lazy" is only a hint. It is important that I lazily load this. Is there a more correct way to do this?
In Entity:
Code:
private byte[] data;
@Lob
@Basic(fetch=FetchType.Lazy)
public byte[] getData() {
return data;
}
...
I am using jboss-4.0.4.GA with a postgres DB
Things I've tried:
I tried using a secondarytable annotation, but the field was still eagerly loaded.
I tried creating a data table and a OneToOne relationship, but when I set this relationship to be lazily loaded, jassist returns an error.
I got it to work with a OneToMany relationship, but that "bugs" me since it is really a one-to-one relationship.
Thanks for the help