#1816 Fix for OneToMany relation to non-cached target bean.

This commit is contained in:
rob bygrave
2019-09-12 14:55:37 +12:00
parent 3495d03706
commit d2ece76ca8
5 changed files with 13 additions and 5 deletions
@@ -226,6 +226,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
desc.registerTable(targetDescriptor.getBaseTable(), this);
}
}
/**
* Return the underlying collection of beans.
*/
@@ -345,7 +346,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
/**
* Add the loaded current bean to its associated parent.
*
* <p>
* Helper method used by Elastic integration when loading with a persistence context.
*/
@Override
@@ -967,6 +968,13 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
elementDescriptor.jsonWriteElement(ctx, element);
}
/**
* Only cache Many Ids if the target bean is also cached.
*/
public boolean isUseCache() {
return targetDescriptor.isBeanCaching();
}
/**
* A Many (element collection) property in bean cache to held as JSON.
*/