+ public void updateRootEntities(Collection<UUID> derivateUuids) {
+ this.derivateEntities = new HashSet<SpecimenOrObservationBase<?>>();
+ this.rootEntities = new HashSet<SpecimenOrObservationBase<?>>();
+ for (UUID uuid : derivateUuids) {
+ SpecimenOrObservationBase<?> derivate = CdmStore.getService(IOccurrenceService.class).load(uuid, SPECIMEN_INIT_STRATEGY);
+ derivateEntities.add(derivate);
+ if(derivate instanceof FieldUnit){
+ rootEntities.add(derivate);
+ }
+ else if(derivate instanceof DerivedUnit){
+ SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
+ if(topMostDerivate!=null){
+ rootEntities.add(topMostDerivate);
+ }
+ }
+ }
+ if(rootEntities.isEmpty()){
+ rootEntities = derivateEntities;
+ }
+ }