package dao; import java.util.List; public class UpdateAll extends SQLStmt { private static final String fs ="UPDATE "; List fields; String increment; public UpdateAll(String table, List fields, String increment) { super(table); this.setFields(fields); this.setIncrement(increment); } @Override public String getSQL() { return this.getFs()+this.getUs(); } @Override public String getFs() { return fs+this.getTable()+" "; } public String getUs(){ String us = "SET "; for(String s:this.getFields()){ us+=s+" = "+s+" + "+this.getIncrement()+", "; } return utils.Utils.cutTail(us,2); } public List getFields() { return fields; } public void setFields(List fields) { this.fields = fields; } public String getIncrement() { return increment; } public void setIncrement(String increment) { this.increment = increment; } }