Editing/updating a table row

One of the most convenient approaches for editing/updating a table row consists of using a special property to track the row edit status. This property can be named edited and it should be of the type boolean (default false). Define it in the POJO class, as shown in the following code:

public class Players {
  ...
  private boolean edited;
  ...
  public boolean isEdited() {
    return edited;
  }

  public void setEdited(boolean edited) {
    this.edited = edited;
  }        
}

Note

If your POJO class is an entity class, then define this new property as transient, using the @Transient annotation or transient modifier. This annotation will tell JPA that this property doesn't participate in persistence and that its values are never stored in the database. ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.