mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
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.
25 lines
504 B
Java
25 lines
504 B
Java
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();
|
|
}
|
|
}
|