#1140 - Error loading embedded instance

The issue was due to the loaded status not being recursively set on embedded
beans after inserts. The test case invoked lazy loading due to that which
lead to the issue.
This commit is contained in:
Rob Bygrave
2017-10-03 12:47:29 +13:00
parent fe1817ef02
commit 721654d033
5 changed files with 44 additions and 13 deletions
@@ -0,0 +1,24 @@
package org.tests.embedded;
import io.ebean.Ebean;
import org.junit.Test;
import org.tests.model.embedded.EAddress;
import org.tests.model.embedded.EPerson;
public class TestEmbeddedEmpty {
@Test
public void insertEmptyEmbedded() {
EPerson person = new EPerson();
person.setName("with empty embedded");
// set empty embedded bean
person.setAddress(new EAddress());
Ebean.save(person);
// treat all embedded properties as loaded
person.getAddress().getCity();
}
}