Project

General

Profile

Revision a9e92136

IDa9e9213695953f21fa85c5d42c689357dcb2da1b
Parent cd53ed98
Child aa478e85

Added by Katja Luther over 2 years ago

fix #5869 adapt implementation for reusing names or taxa with remoting

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategy.java
431 431
            tags.addAll(handleTaggedAutonym(nonViralName));
432 432
        }else{ //not Autonym
433 433
//			String nameCache = nonViralName.getNameCache();  //OLD: CdmUtils.Nz(getNameCache(nonViralName));
434

  
434 435
            List<TaggedText> nameTags = getTaggedName(nonViralName);
435 436
            tags.addAll(nameTags);
436 437
            String authorCache = getAuthorshipCache(nonViralName);
......
835 836

  
836 837
    private String getOriginalNameString(NonViralName<?> currentName, List<TaggedText> originalNameTaggs) {
837 838
		List<String> originalNameStrings = new ArrayList<String>(1);
839
		currentName = HibernateProxyHelper.deproxy(currentName, NonViralName.class);
840
		//Hibernate.initialize(currentName.getRelationsToThisName());
838 841
    	for (NameRelationship nameRel : currentName.getRelationsToThisName()){  //handle list, just in case we have strange data; this may result in strange looking results
839 842
			NameRelationshipType type = nameRel.getType();
840 843
    		if(type != null && type.equals(NameRelationshipType.ORIGINAL_SPELLING())){
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
635 635
    @Transactional
636 636
    public UpdateResult createNewTaxonNode(UUID parentNodeUuid, Taxon newTaxon, Reference ref, String microref){
637 637
        UpdateResult result = new UpdateResult();
638
        newTaxon = (Taxon) taxonService.save(newTaxon);
638

  
639
        UUID taxonUUID = taxonService.saveOrUpdate(newTaxon);
640
        newTaxon = (Taxon) taxonService.load(taxonUUID);
639 641

  
640 642
        TaxonNode parent = dao.load(parentNodeUuid);
641 643
        TaxonNode child = null;
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
3333 3333
		return this.swapSynonymAndAcceptedTaxon(syn, taxon);
3334 3334
	}
3335 3335

  
3336
	@Override
3337
	public UUID saveOrUpdate(TaxonBase taxonbase){
3338
	    if (taxonbase.getName()!= null && taxonbase.getName().getId() > 0){
3339
	        TaxonNameBase name = taxonbase.getName();
3340
	        name = nameService.load(name.getUuid());
3341
	        taxonbase.setName(name);
3342
	    }
3343
	    return super.saveOrUpdate(taxonbase);
3344
	}
3345

  
3336 3346

  
3337 3347

  
3338 3348
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)