Project

General

Profile

Revision c497656b

IDc497656ba067d5826f4eebff1bc442eb054c515a
Parent 63a85a4d
Child dfc93007

Added by Andreas Müller over 2 years ago

ref #7874 implement cache update for additional caches

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Team.java
340 340
		this.hasMoreMembers = hasMoreMembers;
341 341
	}
342 342

  
343
    @Override
344
    public boolean hasUnprotectedCache(){
345
        return super.hasUnprotectedCache()
346
                || !this.protectedNomenclaturalTitleCache
347
                || !this.protectedCollectorTitleCache;
348
    }
349

  
343 350
//*********************** CLONE ********************************************************/
344 351

  
345 352
	/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IdentifiableEntity.java
267 267
        return this.titleCache == null || "".equals(this.titleCache);
268 268
    }
269 269

  
270
    /**
271
     * Returns true if any of the caches is not protected. Needs to be overriden
272
     * by subclass if other caches exist.
273
     */
274
    public boolean hasUnprotectedCache(){
275
        return !this.protectedTitleCache;
276
    }
277

  
270 278
//**************************************************************************************
271 279

  
272 280
    @Override
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonName.java
822 822
        }
823 823
    }
824 824

  
825
    @Override
826
    public boolean hasUnprotectedCache(){
827
        return super.hasUnprotectedCache()
828
                || !this.protectedNameCache
829
                || !this.protectedAuthorshipCache
830
                || !this.protectedFullTitleCache;
831
    }
832

  
825 833
// ****************** GETTER / SETTER ****************************/
826 834

  
827 835
    @Override
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/SpecimenOrObservationBase.java
581 581
        return states;
582 582
    }
583 583

  
584

  
584
    @Override
585
    public boolean hasUnprotectedCache(){
586
        return super.hasUnprotectedCache()
587
                || !this.protectedIdentityCache;
588
    }
585 589

  
586 590
//******************** CLONE **********************************************/
587 591

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IdentifiableServiceBase.java
33 33
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
34 34
import eu.etaxonomy.cdm.model.agent.Person;
35 35
import eu.etaxonomy.cdm.model.agent.Team;
36
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
37 36
import eu.etaxonomy.cdm.model.common.CdmBase;
38 37
import eu.etaxonomy.cdm.model.common.DefinedTerm;
39 38
import eu.etaxonomy.cdm.model.common.ISourceable;
......
294 293
			List<T> entitiesToUpdate = new ArrayList<>();
295 294
			for (T entity : list){
296 295
				HibernateProxyHelper.deproxy(entity, clazz);
297
				if (entity.isProtectedTitleCache() == false || TeamOrPersonBase.class.isAssignableFrom(entity.getClass())){
296
				if (entity.hasUnprotectedCache()){
298 297
				    // always execute for TeamOrPersonBase to allow updating the nomenclaturalTitle
299 298
					updateTitleCacheForSingleEntity(cacheStrategy, entitiesToUpdate, entity);
300 299
				}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)