#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 committed 2017-10-03 12:47:29 +13:00
1 parent fe1817ef02
commit 721654d033
5 files changed
+44 -13

No files matched your search

@@ -609,13 +609,14 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
}
/**
* Set the owner on the embedded bean property.
* For embedded bean set the owner and all properties to be loaded (recursively).
*/
void setEmbeddedOwner(EntityBean owner) {
void setAllLoadedEmbedded(EntityBean owner) {
Object emb = getValue(owner);
if (emb != null) {
setEmbeddedOwner(owner, emb);
EntityBean embeddedBean = (EntityBean) emb;
embeddedBean._ebean_getIntercept().setEmbeddedOwner(owner, propertyIndex);
targetDescriptor.setAllLoaded(embeddedBean);
}
}