public class TestEmbeddedRefreshUpdate extends BaseTestCase {
@Test
public void test() {
EEmbOuter outer = new EEmbOuter();
outer.setNomeOuter("test");
EEmbDatePeriod embeddedBean = new EEmbDatePeriod();
embeddedBean.setDate1(new Date());
outer.setDatePeriod(embeddedBean);
Ebean.save(outer);
EEmbOuter loaded = Ebean.find(EEmbOuter.class).findUnique();
// if commented Ebean saves correctly
Ebean.refresh(loaded);
loaded.getDatePeriod().setDate2(new Date());
// BUG 343
Ebean.save(loaded);
// See BUG 344