7 Replies Latest reply on Sep 29, 2013 7:22 AM by Timo Hahn

    How to find only modified attributes in an Entity




      I am using Jdev

      Here is my requirement, I have an entity with around 50 attributes, There is a updtable view object based on this entity, This view object dragged onto page as updatable af:table component. User may modify any value on the screen, by clicking on Save button, I need to find out what are all the rows has been modified, and I just need only specific modified attribute names and corresponding old value.


      I have used below method,  but I can't hard code 50 attributes to find out whether modified or not..


      What is the best approach to find out only modified attributes and corresponding old values as well




          protected void doDML(int i, TransactionEvent transactionEvent) {

              byte state = this.getEntityState();

              if (state == this.STATUS_MODIFIED) {

                  System.out.println(this.getEmployeeId().toString() +

                                     " Has been Modified ");

                  //Object[] modifiedAttributes =this.getAttributeNames();

                  if (this.isAttributeChanged("FirstName")) {

                      System.out.println(" FirstName Modified");


                  if (this.isAttributeChanged("LastName")) {

                      System.out.println(" FirstName Modified");





              super.doDML(i, transactionEvent);