Project

General

Profile

Revision 4855bbd5

ID4855bbd588ff7da5a92d8eaf485e3f90871e6df1
Parent eabaedb0
Child 6b53ead8, b0412410

Added by Katja Luther over 3 years ago

adding new SpecimenOrObservationType and smaller changes

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermIdInVocabularyComparator.java
26 26
    public int compare(T term1, T term2) {
27 27
        String label1;
28 28
        String label2;
29
        if (term1.equals(term2)){
29
        if (term1.getUuid().equals(term2.getUuid())){
30 30
            return 0;
31 31
        }
32 32

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/SpecimenOrObservationType.java
176 176
	Multimedia(UUID.fromString("bfe3fef8-d294-4554-847a-c9d8a6b74313"), "Multimedia Object", "MM", Media),
177 177

  
178 178
	//14
179
    /**
180
     * Type for all material samples belonging to a particular object or observation or a set of these.
181
     * Specialization of {@link SpecimenOrObservationType#DerivedUnit}.
182
     */
183
    @XmlEnumValue("MaterialSample")
184
    MaterialSample(UUID.fromString("d6395063-63b3-485f-87d1-8b2eaf224a33"), "Material Sample", "MS", DerivedUnit),
185

  
186

  
187
	//15
179 188
	/**
180 189
	 * Type for all field data belonging to a particular object or observation or a set of these.
181 190
	 * Derived from the former (before v3.3 CDM class "FieldUnit".
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
782 782
        assertEquals("Name must have Orchis papilionacea var. schirvanica as second hybrid parent", "Orchis papilionacea var. schirvanica", secondParent.getTitleCache());
783 783
        assertEquals("Hybrid name must have the lower rank ('variety') as rank", Rank.VARIETY(), name1.getRank());
784 784

  
785
      //subspecies and variety with genus part
786
        nameStr = "Orchis morio subsp. syriaca \u00D7 Test papilionacea var. schirvanica";
787
        name1 = parser.parseFullName(nameStr, botanicCode, null);
788
        assertTrue("Name must have hybrid formula bit set", name1.isHybridFormula());
789
        assertEquals("Name must have 2 hybrid parents", 2, name1.getHybridChildRelations().size());
790
        //could also be N. or no genus at all, depends on formatter
791
        assertEquals("Title cache must be correct", "Orchis morio subsp. syriaca \u00D7 Test papilionacea var. schirvanica", name1.getTitleCache());
792
        orderedRels = name1.getOrderedChildRelationships();
793
        assertEquals("Name must have 2 hybrid parents in ordered list", 2, orderedRels.size());
794
        firstParent = orderedRels.get(0).getParentName();
795
        assertEquals("Name must have Orchis morio subsp. syriaca as first hybrid parent", "Orchis morio subsp. syriaca", firstParent.getTitleCache());
796
        secondParent = orderedRels.get(1).getParentName();
797
        assertEquals("Name must have Orchis papilionacea var. schirvanica as second hybrid parent", "Test papilionacea var. schirvanica", secondParent.getTitleCache());
798
        assertEquals("Hybrid name must have the lower rank ('variety') as rank", Rank.VARIETY(), name1.getRank());
799

  
785 800
        //2 subspecies with missing genus and species part #5983
786 801
        nameStr = "Orchis morio subsp. syriaca \u00D7 subsp. schirvanica";
787 802
        name1 = parser.parseFullName(nameStr, botanicCode, null);
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/reference/ReferenceDaoHibernateImpl.java
99 99

  
100 100
	@Override
101 101
    public List<UuidAndTitleCache<Reference>> getUuidAndTitle(Set<UUID> uuids){
102
	    if (uuids.isEmpty()){
103
	        return null;
104
	    }
102 105
        List<UuidAndTitleCache<Reference>> list = new ArrayList<UuidAndTitleCache<Reference>>();
103 106

  
104 107
        Criteria criteria = null;
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/PostMergeEntityListener.java
35 35

  
36 36
    private static Map<Session, Set<CdmBase>> newEntitiesMap = new ConcurrentHashMap<>();
37 37

  
38

  
38 39
    public static void addSession(Session session) {
39 40
        newEntitiesMap.put(session, new HashSet<>());
40 41
    }
......
73 74
        }
74 75

  
75 76

  
77

  
78

  
76 79
    }
77 80

  
81

  
82

  
78 83
    /**
79 84
     * @param entity
80 85
     */
......
89 94
                PolytomousKeyNode node = (PolytomousKeyNode) entity;
90 95
                if (node.getChildren() != null && Hibernate.isInitialized(node.getChildren()) ){
91 96
                    node.removeNullValueFromChildren();
97
                    for (PolytomousKeyNode childNode: node.getChildren()){
98
                        removeNullFromCollections(childNode);
99
                    }
92 100

  
93 101
                }
94 102

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)