mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1167 - BUG: query.setId(...).delete() does not work
This commit is contained in:
@@ -51,6 +51,22 @@ public class TestDeleteByQuery extends BaseTestCase {
|
||||
assertThat(list).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryByIdDelete() {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
Ebean.find(Contact.class).where().eq("id", 7000).delete();
|
||||
Ebean.find(Contact.class).setId(7000).delete();
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
assertThat(sql.get(0)).contains("delete from contact where id = ?");
|
||||
assertThat(sql.get(1)).contains("delete from contact where id = ?");
|
||||
|
||||
// and note this is the easiest option
|
||||
Ebean.delete(Contact.class, 7000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithForUpdate() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user