Project

General

Profile

« Previous | Next » 

Revision ee0eed2d

Added by Andreas Müller over 12 years ago

quickfix for annotationtype transient object in SDDImport

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/sdd/in/SDDImport.java
21 21
import java.util.List;
22 22
import java.util.Map;
23 23
import java.util.Set;
24
import java.util.UUID;
24 25

  
25 26
import org.apache.commons.lang.StringUtils;
26 27
import org.apache.log4j.Logger;
......
96 97

  
97 98
	private static int modCount = 1000;
98 99

  
100
	private UUID uuidAnnotationTypeLocation = UUID.fromString("a3737e07-72e3-46d2-986d-fa4cf5de0b63");
101
	
102
	
99 103
	private Map<String,Person> authors = new HashMap<String,Person>();
100 104
	private Map<String,String> citations = new HashMap<String,String>();
101 105
	private Map<String,String> defaultUnitPrefixes = new HashMap<String,String>();
......
605 609
		for (String ref : taxonDescriptions.keySet()){
606 610
			TaxonDescription td = taxonDescriptions.get(ref);
607 611
			if (citations.containsKey(ref)) {
608
				Reference publication = publications.get(citations.get(ref));
612
				Reference<?> publication = publications.get(citations.get(ref));
609 613
				if (locations.containsKey(ref)) {
610 614
					Annotation location = Annotation.NewInstance(locations.get(ref), datasetLanguage);
611
					AnnotationType annotationType = AnnotationType.NewInstance("", "location", "");
612
					annotationTypes.add(annotationType);
615
					//TODO move to a generic place (implemented in hurry therefore dirty)
616
					AnnotationType annotationType = getAnnotationType(state, uuidAnnotationTypeLocation, "location", "location", "location", null);
617
//					annotationTypes.add(annotationType);  TODO necessary??
613 618
					location.setAnnotationType(annotationType);
614 619
					(publication).addAnnotation(location);
615 620
				}
......
662 667

  
663 668
	private void saveAnnotationType() {
664 669
		for (AnnotationType annotationType: annotationTypes){
665
			getTermService().save(annotationType); 
670
			getTermService().saveOrUpdate(annotationType); 
666 671
		}
667 672
	}
668 673

  

Also available in: Unified diff