Results 1 to 3 of 3

Thread: transient field property

  1. #1

    Default 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,

  2. #2

    Default

    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

  3. #3
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •