-->
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: How can i make the compoent lazy?
PostPosted: Mon Jan 15, 2007 4:24 am 
Newbie

Joined: Mon Jan 15, 2007 4:05 am
Posts: 2
as titled.

The value-based property could be lazily loaded with the following code after I ran InstrumentTask to do the bytecode instrument:

Code:
   @NotEmpty
   @Length(max = 100)
   @Column(columnDefinition = "nvarchar(100)")
   @Basic(fetch=FetchType.LAZY)
   public String getName() {
      return name;
   }


But the component couldn't:

Code:
   @Embedded
   @Basic(fetch=FetchType.LAZY)
   public Attachment getAttachment() {
      return attachment;
   }


What i want to do is to load the byte[] lazily, and the Attachment contains the byte[]. And i do another try, to lazily load the byte[] directly. But it doesn't work either.

Code:
@Embeddable
public class AttachmentContent extends PersistentBean implements Serializable {

   private byte[] content;
   @Lob
   @Basic(fetch=FetchType.LAZY)
   public byte[] getContent() {
      return content;
   }


But when i move the byte[] to the owning entity, it works. So i think my problem is "how to lazily load a compoent or properties in the compoent?"


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.