@Test void update() { Database database = Database.newBuilder() .defaultSchema("SIESTA") .table(WidgetRow.class, t -> t.builder(WidgetRow.Builder::build)) .build(); database.update(WidgetRow.class, "w") .set(WidgetRow::name).to("Fred") .set(WidgetRow::description).to(Optional.of("Bob")) .where(WidgetRow::widgetId).isEqualTo(1L) .and(column(WidgetRow::description).isBetween("A").and("w", WidgetRow::name) .or(column(WidgetRow::description).isNull())) .execute(transaction); verify(transaction).update(sql.capture(), args.capture()); assertThat(sql.getValue(), is("update SIESTA.WIDGET w " + "set NAME = ?, " + "DESCRIPTION = ? " + "where w.WIDGET_ID = ? " + "and (" + "w.DESCRIPTION between ? and w.NAME " + "or w.DESCRIPTION is null" + ")")); assertThat(args.getValue(), is(toArray("Fred", "Bob", 1L, "A"))); }
private Update(Database database, Alias<U> alias) { super(new Scope(database, alias)); this.alias = alias; }
Update extends ExecutableStatement { private Update(Database database, Alias<U> alias) { super(new Scope(database, alias)); this.alias = alias; } }
Update extends ExecutableStatement { private Update(Database database, Alias<U> alias) { super(new Scope(database, alias)); this.alias = alias; } private  Update(Database database, Alias<U> alias); }
Update extends ExecutableStatement { private Update(Database database, Alias<U> alias) { super(new Scope(database, alias)); this.alias = alias; } private  Update(Database database, Alias<U> alias); static InSetExpectingWhere<U> update(Database database, Table<U> table); static InSetExpectingWhere<U> update(Database database, Alias<U> alias); }
Update extends ExecutableStatement { private Update(Database database, Alias<U> alias) { super(new Scope(database, alias)); this.alias = alias; } private  Update(Database database, Alias<U> alias); static InSetExpectingWhere<U> update(Database database, Table<U> table); static InSetExpectingWhere<U> update(Database database, Alias<U> alias);  }