Project

General

Profile

« Previous | Next » 

Revision 892efc69

Added by Andreas Kohlbecker almost 14 years ago

merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Taxon.java
88 88
	@XmlElementWrapper(name = "Descriptions")
89 89
	@XmlElement(name = "Description")
90 90
	@OneToMany(mappedBy="taxon", fetch= FetchType.LAZY) 
91
	@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE, CascadeType.DELETE_ORPHAN})
91
	@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE})
92 92
	@NotNull
93 93
	private Set<TaxonDescription> descriptions = new HashSet<TaxonDescription>();
94 94

  
......
597 597
	 * @param type			the taxon relationship type for the new taxon relationship
598 598
	 * @param citation		the reference source for the new taxon relationship
599 599
	 * @param microcitation	the string with the details describing the exact localisation within the reference
600
	 * @return 
600 601
	 * @see    	   			#addTaxonRelation(TaxonRelationship)
601 602
	 * @see    	   			#getTaxonRelations()
602 603
	 * @see    	   			#getRelationsFromThisTaxon()
......
604 605
	 * @see    	   			#getTaxonomicParent()
605 606
	 * @see    	   			#getTaxonomicChildrenCount()
606 607
	 */
607
	public void addTaxonRelation(Taxon toTaxon, TaxonRelationshipType type, ReferenceBase citation, String microcitation) {
608
		TaxonRelationship rel = new TaxonRelationship(this, toTaxon, type, citation, microcitation);
608
	public TaxonRelationship addTaxonRelation(Taxon toTaxon, TaxonRelationshipType type, ReferenceBase citation, String microcitation) {
609
		return new TaxonRelationship(this, toTaxon, type, citation, microcitation);
609 610
	}
610 611
	/**
611 612
	 * Creates a new {@link TaxonRelationship taxon relationship} (with {@link TaxonRelationshipType taxon relationship type}
......
617 618
	 * @param misappliedNameTaxon	the taxon which plays the target role in the new taxon relationship
618 619
	 * @param citation				the reference source for the new taxon relationship
619 620
	 * @param microcitation			the string with the details describing the exact localisation within the reference
621
	 * @return 
620 622
	 * @see    	   					#getMisappliedNames()
621 623
	 * @see    	   					#addTaxonRelation(Taxon, TaxonRelationshipType, ReferenceBase, String)
622 624
	 * @see    	   					#addTaxonRelation(TaxonRelationship)
......
624 626
	 * @see    	   					#getRelationsFromThisTaxon()
625 627
	 * @see    	   					#getRelationsToThisTaxon()
626 628
	 */
627
	public void addMisappliedName(Taxon misappliedNameTaxon, ReferenceBase citation, String microcitation) {
628
		misappliedNameTaxon.addTaxonRelation(this, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), citation, microcitation);
629
	public TaxonRelationship addMisappliedName(Taxon misappliedNameTaxon, ReferenceBase citation, String microcitation) {
630
		return misappliedNameTaxon.addTaxonRelation(this, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), citation, microcitation);
629 631
	}
630 632

  
631 633
//	public void removeMisappliedName(Taxon misappliedNameTaxon){
......
1306 1308
	 * @see    	   			Synonym#getSynonymRelations()
1307 1309
	 */
1308 1310
	public SynonymRelationship addHomotypicSynonym(Synonym synonym, ReferenceBase citation, String microCitation){
1309
		if (this.getName() != null){
1311
	if (this.getName() != null){
1312
			if (this.getName().getHomotypicalGroup().getTypifiedNames().isEmpty()){
1313
				this.getName().getHomotypicalGroup().getTypifiedNames().add(this.getName());
1314
			
1315
			}
1310 1316
			this.getName().getHomotypicalGroup().addTypifiedName(synonym.getName());
1317
			
1311 1318
		}
1312 1319
		SynonymRelationship synRel = addSynonym(synonym, SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF(), citation, microCitation);
1313 1320
		return synRel;
......
1551 1558
		}
1552 1559
		if (result == null){
1553 1560
			result = TaxonDescription.NewInstance();
1554
			result.setTitleCache(titleCache);
1561
			result.setTitleCache(titleCache, true);
1555 1562
			this.addDescription(result);
1556 1563
			result.setImageGallery(true);
1557 1564
		}

Also available in: Unified diff