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