-->
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.  [ 4 posts ] 
Author Message
 Post subject: Lazy loading for @Formula
PostPosted: Wed Apr 05, 2006 10:46 am 
Newbie

Joined: Wed Mar 08, 2006 9:10 pm
Posts: 7
I have declared a formula-property like this:

Code:
@Formula("(SELECT count(*) FROM Thread t WHERE t.board_id = board_id)")
private int threadCount;


But unfortunately I didn't find the way how to declare this formula as "lazy" in the documentation.

Any hint? Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 11:50 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
@Basic(fetch=LAZY)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 10:46 am 
Newbie

Joined: Wed Mar 08, 2006 9:10 pm
Posts: 7
I tried it, but it doesn't work as expected. Hibernate still executes the same query as before.
I am using 3.1beta9 btw.

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 11:18 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you must enhance your classes at build time to make it work, check the hobernate core ref doc about that

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.