Project

General

Profile

Revision 692d6943

ID692d6943700d9caa01d523b5fccf110829b8020a
Parent db06a452
Child 56d00492

Added by Katja Luther almost 4 years ago

fix performance problem in namedArea selection dialog

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
26 26

  
27 27
import eu.etaxonomy.cdm.api.service.ITermService;
28 28
import eu.etaxonomy.cdm.api.service.IVocabularyService;
29
import eu.etaxonomy.cdm.model.common.CdmBase;
29
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
30 30
import eu.etaxonomy.cdm.model.common.TermType;
31 31
import eu.etaxonomy.cdm.model.common.TermVocabulary;
32 32
import eu.etaxonomy.cdm.model.location.NamedArea;
......
143 143
	/** {@inheritDoc} */
144 144
	@Override
145 145
	protected NamedArea getPersistentObject(UUID uuid) {
146
		for(TermVocabulary<NamedArea> vocabulary : selectedVocabularies){
147
			for(Object object : vocabulary.getTerms()){
148
				CdmBase cdmBaseObject = (CdmBase) object;
149
				if(uuid.equals(cdmBaseObject.getUuid())){
150
					return CdmBase.deproxy(cdmBaseObject, NamedArea.class);
151
				}
152
			}
153
		}
146

  
147
	    DefinedTermBase area =  CdmStore.getService(ITermService.class).find(uuid);
148
	    if (area instanceof NamedArea){
149
	        return (NamedArea) area;
150
	    }
151

  
154 152
		return null;
155 153
	}
156 154

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)