NPE in cacheable bean with embeddedid on delete (#1570)

This commit is contained in:
Rien authored and Rob Bygrave committed 2018-12-05 21:49:27 +13:00
1 parent ebf96c87bf
commit 0405ceb96c
2 files changed
+23

No files matched your search

@@ -32,4 +32,23 @@ public class TestCKeyDelete extends BaseTestCase {
Assert.assertNull(notFound);
}
@Test
public void testDeleteWhere() {
CKeyParentId id = new CKeyParentId(100, "deleteMe");
CKeyParentId searchId = new CKeyParentId(100, "deleteMe");
CKeyParent p = new CKeyParent();
p.setId(id);
p.setName("testDelete");
Ebean.save(p);
Ebean.createQuery(CKeyParent.class).where().eq("id.oneKey", 100).delete();
CKeyParent found = Ebean.find(CKeyParent.class).where().idEq(searchId).findOne();
Assert.assertNull(found);
}
}