-->
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: Wierd behavoir after changing getter
PostPosted: Wed Aug 11, 2010 9:15 am 
Newbie

Joined: Wed Aug 11, 2010 9:01 am
Posts: 1
Hi, I am new to HIbernate, I have got a wierd behavior after changing the getter of a domain object. The change mainly was to remove the whitespace in the returned string,
Code:
public String getSomthing() {
   return this.something.[u]trim();[/u]
}


The only difference from normal getter is there is a trim() after the returning string. And I got following wierd behavior.

I have a Struts front end using a s:select tag to access a list of "something" through a service call "retrieveAllxxx" (note: this call is returning a list of converted key-value pair, not the original domain object any more). If I put the trim() function outside the getter, e.g., in the service all after getting the domain values and trimmed them, then everything worked fine. However, if I put the trim inside the getter, the s:select tag would complain can't resolve the list. (could not be resolved as a collection/array/map/enumeration/iterator type error), which means the list is not populated. I traced the "retrieveAllxxx" method, each time it seemed still return the same list (visually in debugger, the results in two cases are the same). Why am I still getting the list not populated errot? (this seems to be related to lazy-loading? but I am not using domain object directly, it is the converted key-value type in the UI )..

anyone with any clue?

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.