mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user