users@glassfish.java.net

Can I have a lazy loading for _at_Lob?

From: <glassfish_at_javadesktop.org>
Date: Fri, 14 Dec 2007 07:26:04 PST

I have a table A with a blob field (in mysql 5)
this blob contains a png data.

I have an entity that represent table A (entityA) [I use top link essential]
In this entity I have this mapping for blob field

@Lob
@Basic(fetch=FetchType.LAZY)
@Column(name = "screenshot")
private byte[] screenshot;

I wish to obtain a lazy loading (like collection in X to many relationship) for the screenshot field, in order to load it only when the property is accessed.

But when I debug my web application (where I retrieve the entityA thru session facade for entityA) the screenshot is loaded when the entityA instaces is created.

So, Is it possible to load the field only when it is accessed?
[Message sent by forum member 'peppeme' (peppeme)]

http://forums.java.net/jive/thread.jspa?messageID=250128