mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +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:
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user