No effective change - add test for PrimaryKeyJoinColumn - insertWithoutExtra

This commit is contained in:
rob bygrave committed 2018-05-24 00:07:30 +12:00
1 parent a9a89938f9
commit ae58d9223a
1 file changed
+19
@@ -21,6 +21,25 @@ public class TestOneToOnePrimaryKeyJoinOptional extends BaseTestCase {
return prime;
}
@Test
public void insertWithoutExtra() {
String desc = "" + System.currentTimeMillis();
OtoUPrime p1 = new OtoUPrime("u" + desc);
Ebean.save(p1);
Query<OtoUPrime> query = Ebean.find(OtoUPrime.class)
.setId(p1.getPid())
.fetch("extra", "eid");
OtoUPrime found = query.findOne();
if (found.getExtra() != null) {
found.getExtra().getExtra(); // fails here, because getExtra should be null
}
assertThat(found.getExtra()).isNull();
}
@Test
public void insertUpdateDelete() {