Revision 5d2a77b2
Added by Andreas Müller about 5 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Team.java | ||
---|---|---|
342 | 342 |
|
343 | 343 |
|
344 | 344 |
@Override |
345 |
public boolean hasUnprotectedCache(){ |
|
346 |
return super.hasUnprotectedCache() |
|
347 |
|| !this.protectedNomenclaturalTitleCache |
|
348 |
|| !this.protectedCollectorTitleCache; |
|
349 |
} |
|
345 |
public boolean updateCaches(){ |
|
346 |
boolean result = super.updateCaches(); |
|
347 |
if (this.protectedNomenclaturalTitleCache == false){ |
|
348 |
String oldNomTitleCache = this.nomenclaturalTitle; |
|
349 |
this.protectedNomenclaturalTitleCache = false; |
|
350 |
|
|
351 |
String newAbbrevTitleCache = cacheStrategy.getTitleCache(this); |
|
352 |
|
|
353 |
if ( oldNomTitleCache == null || ! oldNomTitleCache.equals(newAbbrevTitleCache) ){ |
|
354 |
this.setNomenclaturalTitle(null, false); |
|
355 |
String newCache = this.getNomenclaturalTitle(); |
|
356 |
|
|
357 |
if (newCache == null){ |
|
358 |
logger.warn("New nomTitleCache should never be null"); |
|
359 |
} |
|
360 |
if (oldNomTitleCache == null){ |
|
361 |
logger.info("Old nomTitleCache should never be null"); |
|
362 |
} |
|
363 |
result = true; |
|
364 |
} |
|
365 |
} |
|
366 |
return result; |
|
367 |
} |
|
350 | 368 |
|
351 | 369 |
//*********************** CLONE ********************************************************/ |
352 | 370 |
|
Also available in: Unified diff
ref #8030 Move cache updating to model classes, no tests yet