Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA Using @Lob and lazyfetch option  RSS feed

 
Shayan Shah
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As according to JPA recommendations, I am using the @Lob on the ''image' field which is of type byte[] and fetch type is lazy.

public class Member implements Serializable {
...........

@Lob
@Basic(fetch=FetchType.LAZY,optional=true)
@Column(name = "image")
private byte[] image;

...........
}


According to this, when I query, the images must not be loaded into memory as its Lazy fetch but still they are being loaded.
I am using Hibernate as persistence provider. what can be the problem?

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!