Try to fix ClassCastException in isToManyDirty() check

This commit is contained in:
Vladimir Konkov
2021-09-20 20:02:58 +03:00
parent b450227b13
commit 01e7ddcffd
2 changed files with 35 additions and 2 deletions
@@ -2875,8 +2875,8 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
final EntityBeanIntercept ebi = bean._ebean_getIntercept();
for (BeanPropertyAssocMany<?> many : propertiesManySave) {
if (ebi.isLoadedProperty(many.propertyIndex())) {
final BeanCollection<?> value = (BeanCollection<?>) many.getValue(bean);
if (value != null && value.hasModifications()) {
final Object value = many.getValue(bean);
if (value instanceof BeanCollection && ((BeanCollection<?>)value).hasModifications() || value != null) {
return true;
}
}