Revision 4bafd675
Added by Andreas Müller almost 3 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Person.java | ||
---|---|---|
36 | 36 |
import org.hibernate.search.annotations.IndexedEmbedded; |
37 | 37 |
import org.springframework.beans.factory.annotation.Configurable; |
38 | 38 |
|
39 |
import eu.etaxonomy.cdm.common.CdmUtils; |
|
39 | 40 |
import eu.etaxonomy.cdm.hibernate.search.OrcidBridge; |
40 | 41 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
41 | 42 |
import eu.etaxonomy.cdm.strategy.cache.agent.PersonDefaultCacheStrategy; |
... | ... | |
455 | 456 |
public boolean updateCaches(){ |
456 | 457 |
boolean result = false; |
457 | 458 |
result |= super.updateCaches(); |
458 |
if (this.nomenclaturalTitle == null){ |
|
459 |
this.nomenclaturalTitleCache = this.getTitleCache(); |
|
460 |
if ( this.nomenclaturalTitleCache != null ){ |
|
461 |
result = true; |
|
462 |
} |
|
463 |
} |
|
459 |
result |= updateNomenclaturalCache(); |
|
460 |
result |= updateCollectorCache(); |
|
464 | 461 |
|
465 | 462 |
return result; |
463 |
} |
|
464 |
|
|
465 |
private boolean updateNomenclaturalCache() { |
|
466 |
//updates the nomenclaturalTitleCache if necessary |
|
467 |
String oldCache = this.nomenclaturalTitleCache; |
|
468 |
String newCache = getCacheStrategy().getNomenclaturalTitleCache(this); |
|
469 |
if (!CdmUtils.nullSafeEqual(oldCache, newCache)){ |
|
470 |
// this.setNomenclaturalTitleCache(null, false); |
|
471 |
this.getNomenclaturalTitleCache(); |
|
472 |
return true; |
|
473 |
} |
|
474 |
return false; |
|
475 |
} |
|
476 |
|
|
477 |
private boolean updateCollectorCache() { |
|
478 |
//updates the collectorTitleCache if necessary |
|
479 |
String oldCache = this.collectorTitleCache; |
|
480 |
String newCache = getCacheStrategy().getCollectorTitleCache(this); |
|
481 |
if (!CdmUtils.nullSafeEqual(oldCache, newCache)){ |
|
482 |
// this.setNomenclaturalTitleCache(null, false); |
|
483 |
this.getCollectorTitleCache(); |
|
484 |
return true; |
|
485 |
} |
|
486 |
return false; |
|
466 | 487 |
} |
467 | 488 |
|
468 | 489 |
//*********************** CLONE ********************************************************/ |
Also available in: Unified diff
ref #9664 , ref #4311 fix updateCaches in Person