Project

General

Profile

Revision 6870dcc1

ID6870dcc1845a771a06c63998f2b0115d91a7b13d
Parent f8dac431
Child ebac9359

Added by Andreas Kohlbecker almost 4 years ago

fixing wrong handling of proxies which are hidden in collections (bug fix 2)

View differences:

cdmlib-cache/src/main/java/eu/etaxonomy/cdm/cache/CacheLoader.java
295 295
     */
296 296
    private CdmBase loadRecursive(CdmBase cdmEntity,  List<Object> alreadyVisitedEntities, boolean update) {
297 297

  
298
        CdmBase cdmEntityDeproxied = (CdmBase)ProxyUtils.deproxyOrNull(cdmEntity);
299
        if(cdmEntityDeproxied == null){
300
            return cdmEntity;
301
        } else {
302
            cdmEntity = cdmEntityDeproxied;
303
        }
304

  
305 298
        CdmBase cachedCdmEntity = load(cdmEntity);
306 299

  
307 300
        // we want to recursive through the cdmEntity (and not the cachedCdmEntity)
308 301
        // since there could be new or deleted objects in the cdmEntity sub-graph
309 302

  
310 303
        // start by getting the fields from the cdm entity
311
        String className = cdmEntity.getClass().getName();
304
        String className = ProxyUtils.deproxy(cdmEntity).getClass().getName();
312 305
        CdmModelFieldPropertyFromClass cmgmfc = getFromCdmlibModelCache(className);
313 306
        if(cmgmfc != null) {
314 307
            alreadyVisitedEntities.add(cdmEntity);
......
381 374

  
382 375
            if(field == null) {
383 376
                throw new CdmClientCacheException("Field '" + fieldName
384
                        + "' not found when searching in class '" + clazz.getName() + "' and its supercalsses");
377
                        + "' not found when searching in class '" + clazz.getName() + "' and its superclasses");
385 378
            }
386 379
            field.setAccessible(true);
387 380
            Object o = field.get(cdmEntity);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)