mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-25 07:17:57 +00:00
No effective change - add test for PrimaryKeyJoinColumn - insertWithoutExtra
This commit is contained in:
1 parent
a9a89938f9
commit
ae58d9223a
1 file changed
+19
@@ -21,6 +21,25 @@ public class TestOneToOnePrimaryKeyJoinOptional extends BaseTestCase {
|
|||||||
return prime;
|
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
|
@Test
|
||||||
public void insertUpdateDelete() {
|
public void insertUpdateDelete() {
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user