-->
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: programmatically set lazy fetch for a field in an object
PostPosted: Sun Oct 21, 2007 4:14 pm 
Newbie

Joined: Wed Oct 20, 2004 1:48 am
Posts: 2
Is this possible?

I have a log table with a text column, the content of the text often exceeds 200 characters. Many of my webpages list and filter on the logs without needing the text column.

I know I can set the text field to "lazy" in my hbm.xml, but sometimes I do need to get the text field in the presentation layer, where the transaction is close.

I also understand I can move the text field to a separate table and do a one-to-one mapping, which allows me to set the fetch mode for the child object programmatically. But this seems to be a lot of work and I already have a lot of production log data.

Basically, I am looking for something like crit.setFetchMode("log.text", FetchMode.SELECT);

Is this possible?

Thanks.


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.