field.setAccessible(true);
Object o = field.get(cdmEntity);
+ // in the case that we are (re) loading a cdm entity with a null (most probably deleted) field
+ // we need to set the same field in the corresponding cached cdm entity to null
+ if(o == null) {
+ field.set(cachedCdmEntity, null);
+ }
+
CdmBase cdmEntityInSubGraph = null;
if(o != null
&& !ProxyFactory.isProxyClass(o.getClass())
&& !(o instanceof PersistentCollection) ) {
-
if(CdmBase.class.isAssignableFrom(o.getClass())) {
logger.info("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
cdmEntityInSubGraph = (CdmBase)o;