-->
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.  [ 7 posts ] 
Author Message
 Post subject: How to set not lazy for class
PostPosted: Mon Jul 09, 2007 11:51 am 
Beginner
Beginner

Joined: Tue Jul 03, 2007 11:36 am
Posts: 24
I do not want lazy loading for user object after entityMnager.load(User.class,id); so how to set the annotation for that User class? Now i have to do n user.getUsername to load that object out before close the session.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 1:14 pm 
Beginner
Beginner

Joined: Mon May 21, 2007 5:22 pm
Posts: 27
Location: Salt Lake City
You need to define lazy setting in your hbm file for that class.

_________________
Try 'N' Enjoy !!
Rahul

If helpful do rating ....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 9:51 pm 
Beginner
Beginner

Joined: Tue Jul 03, 2007 11:36 am
Posts: 24
I am using annotation. I am not sure how to code in annotation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use entityManager.find()
BTW em.load does not exists

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 2:25 am 
Beginner
Beginner

Joined: Tue Jul 03, 2007 11:36 am
Posts: 24
I have change the load() to get() already. Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 1:07 pm 
Newbie

Joined: Sun Oct 30, 2005 2:38 pm
Posts: 9
Location: Goodyear, AZ
emmanuel wrote:
use entityManager.find()

No other way, eh? I'm using Annotations without EM. Do I have to add @Basic(fetch = EAGER) to all of my properties? I'm getting LIEs where none were with hbm files. Essentially, I don't want Hibernate to proxy some of my objects at all.

Thanks
- Eric


Top
 Profile  
 
 Post subject: Just found it!
PostPosted: Wed Aug 29, 2007 4:39 pm 
Newbie

Joined: Sun Oct 30, 2005 2:38 pm
Posts: 9
Location: Goodyear, AZ
Oh, wait, never mind. Looks like I just found it. I annotated the bean with
Code:
@org.hibernate.annotations.Proxy(lazy = false)


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

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.