-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: lob + lazy-loading
PostPosted: Wed Sep 24, 2008 12:50 pm 
Newbie

Joined: Wed Sep 24, 2008 11:53 am
Posts: 2
Dear all,

I ask myself what's the best way to manage lazy-loading + embedded object with a Lob property.

1°) Here's my environment:
- JPA as API
- Hibernate as implémentation with following versions:
hibernate-3.2.4.jar
hibernate-entitmanager-3.3.1.ga.jar
hibernate-annotations-3.3.0.ga.jar


2°) Here's my very simple domain model:
a Personne who embeddes an object of type PersonnePhoto, and this one having a property of type java.sql.Blob.

Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Personne implements Serializable {
...
 
  @Embedded
  @Basic(fetch = FetchType.LAZY)
  private PersonnePhoto personnePhoto;
}


Code:
@Embeddable
public class PersonnePhoto {
  ....
  @Lob
  @Column(name="PABLOB")
  private java.sql.Blob photo;

  private String name;

}



I thought that i just had to to enable interception on the component property personnePhoto with annotation @Basic(fetch = FetchType.LAZY) but it does not seem to run well, because when i load Person entites, Hibernate loads the lob also.

What is not clear to me is, if it's the correct way to do, if need or not to instrument the bytecode of my class Personn after compilation.

Thanks for your lights,
Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.