-
Sep 15th, 2011, 03:00 PM
#1
transient field property
Hi,
In my entity class I have declared a transient field and created getter/setter methods. Based on a property of entity class, I have to populate the transient field value. As @Formula annotation is not working for me, I have to modify the getter method by calling a sql statement.
I am getting the value as per my desire, how ever my getter method is called 6times while show.jspx is called. All I can say is I have 6 fields defined in my entity class.
Why my getter method is called multiple times? Any help is highly appreciated.
Thanks,
-
Sep 20th, 2011, 10:21 AM
#2
Hi,
Please help me in understanding why the getter method is called multiple times. Also, how do I use init method using annotations? Will that solve this problem?
Thanks,
Gupta
-
Sep 20th, 2011, 11:09 PM
#3
Hi Gupta,
The problem is that the Spring MVC EL integration uses the toString() method on your type quite frequently. Normally this has no major impact on your application but since you are calling DB functionality from your accessor it becomes a problem. The solution is to push in the toString() method into the .java source and remove the getXX() call from it. Alternatively you can remove the @RooToString annotation from the type.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules