Update extends QueryBuilder { Update(QueryBuilderOptions options) { super(options, Arrays.asList( new StringBlock(options, "UPDATE"), new UpdateTableBlock(options), new SetFieldBlock(options), new WhereBlock(options), new OrderByBlock(options), new LimitBlock(options) )); } Update(QueryBuilderOptions options); @Override QueryBuilder table(String table, String alias); @Override QueryBuilder set(String field, T value); @Override QueryBuilder where(String condition, P param); @Override QueryBuilder where(Expression condition, P param); @Override QueryBuilder order(String field, SortOrder dir); @Override QueryBuilder limit(int value);  }
@Test(expected=UnsupportedOperationException.class) public void fromTableShouldThrow() { Squel.update() .from("TABLE"); }
@Test(expected=UnsupportedOperationException.class) public void fromQueryBuilderShouldThrow() { QueryBuilder q = Squel.select(); Squel.update() .from(q); }
@Test(expected=UnsupportedOperationException.class) public void distinctShouldThrow() { Squel.update() .distinct(); }
@Test(expected=UnsupportedOperationException.class) public void fieldShouldThrow() { Squel.update() .field("NAME"); }
@Test(expected=UnsupportedOperationException.class) public void fieldsShouldThrow() { Squel.update() .fields(Arrays.asList("NAME", "NAME2")); }
@Test(expected=UnsupportedOperationException.class) public void fieldQueryBuilderShouldThrow() { QueryBuilder q = Squel.select(); Squel.update() .field(q); }
@Test(expected=UnsupportedOperationException.class) public void groupShouldThrow() { Squel.update() .group("NAME"); }
@Test(expected=UnsupportedOperationException.class) public void joinTableShouldThrow() { Squel.update() .join("NAME"); }
@Test(expected=UnsupportedOperationException.class) public void joinTableExpressionShouldThrow() { Squel.update() .join("NAME", "A", Squel.expr()); }
@Test(expected=UnsupportedOperationException.class) public void joinQueryBuilderShouldThrow() { QueryBuilder q = Squel.select(); Squel.update() .join(q, "A", "B"); }
@Test(expected=UnsupportedOperationException.class) public void joinQueryBuilderExpressionShouldThrow() { QueryBuilder q = Squel.select(); Squel.update() .join(q, "A", Squel.expr()); }