mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
NPE in cacheable bean with embeddedid on delete (#1570)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.Cache;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
@@ -10,6 +13,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Cache
|
||||
public class CKeyParent {
|
||||
|
||||
@EmbeddedId
|
||||
|
||||
Reference in New Issue
Block a user