1 Reply Latest reply on Mar 8, 2012 7:51 AM by Sergio Angelo

    How to avoid record updated automatically when records are retrieved

    chung siu man Newbie

      Dear All,


      I have a function written in richfaces 3.2.2 and backend is Seam 2.

      User will click a "retrieve" button of that function and a list of record is being displayed from database.

      However I found records are being updated automatically if the retrieve method contains "set" methods as below:


      public void getHotels() {


              hotels = em.createQuery("select h from Hotel h")



              for (Hotel h : hotels) {

                  if (h.getId()-1==0) {



                      h.setAddress("1");   <------------------------- entity is updated





      I want to disable the above automatic entity update; I want to save records only when used click "save" button.


      Please help and thanks