Revision bd45d1fc
Added by Patrick Plitzner about 6 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java | ||
---|---|---|
985 | 985 |
return result; |
986 | 986 |
} |
987 | 987 |
|
988 |
@Override |
|
989 |
public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen) { |
|
990 |
// potential fields that are not persisted cascadingly |
|
991 |
/* |
|
992 |
* SOOB |
|
993 |
-DescriptionBase |
|
994 |
-determinations |
|
995 |
--modifier TERM |
|
996 |
-kindOfUnit TERM |
|
997 |
-lifeStage TERM |
|
998 |
-sex TERM |
|
999 |
|
|
1000 |
FieldUnit |
|
1001 |
-GatheringEvent |
|
1002 |
--Country TERM |
|
1003 |
--CollectingAreas TERM |
|
1004 |
|
|
1005 |
DerivedUnit |
|
1006 |
-collection |
|
1007 |
--institute |
|
1008 |
---types TERM |
|
1009 |
-preservationMethod |
|
1010 |
--medium TERM |
|
1011 |
-storedUnder CDM TaxonName |
|
1012 |
*/ |
|
1013 |
|
|
1014 |
Collection<ICdmBase> nonCascadedCdmEntities = new HashSet<>(); |
|
1015 |
|
|
1016 |
//Choose the correct entry point to traverse the graph (FieldUnit or DerivedUnit) |
|
1017 |
|
|
1018 |
// FieldUnit |
|
1019 |
if (specimen.isInstanceOf(FieldUnit.class)) { |
|
1020 |
nonCascadedCdmEntities.addAll(getFieldUnitNonCascadedAssociatedElements(HibernateProxyHelper.deproxy(specimen, FieldUnit.class))); |
|
1021 |
} |
|
1022 |
// DerivedUnit |
|
1023 |
else if (specimen.isInstanceOf(DerivedUnit.class)) { |
|
1024 |
DerivedUnit derivedUnit = HibernateProxyHelper.deproxy(specimen, DerivedUnit.class); |
|
1025 |
if (derivedUnit.getDerivedFrom() != null) { |
|
1026 |
Collection<FieldUnit> fieldUnits = getFieldUnits(derivedUnit, null); |
|
1027 |
for (FieldUnit fieldUnit : fieldUnits) { |
|
1028 |
nonCascadedCdmEntities.addAll(getFieldUnitNonCascadedAssociatedElements(fieldUnit)); |
|
1029 |
} |
|
1030 |
} |
|
1031 |
} |
|
1032 |
return nonCascadedCdmEntities; |
|
1033 |
} |
|
1034 |
|
|
1035 | 988 |
private Collection<ICdmBase> getFieldUnitNonCascadedAssociatedElements(FieldUnit fieldUnit) { |
1036 | 989 |
// get non cascaded element on SpecimenOrObservationBase level |
1037 | 990 |
Collection<ICdmBase> nonCascadedCdmEntities = getSpecimenOrObservationNonCascadedAssociatedElements(fieldUnit); |
Also available in: Unified diff
Remove unused occurrence service method