- /**
- * Searches for {@link SpecimenOrObservationBase} with the parameters specified in the {@link IIdentifiableEntityServiceConfigurator}
- * which match the given {@link SpecimenOrObservationType}
- * @param configurator the configurator to use for the search
- * @param type the type/record basis the specimens must have
- * @return a list of the SpecimenOrObservationBases matching the search parameters found
-
- * @deprecated method needs to be optimized with a direct SQL query instead of iterating over all specimens
- */
- @Deprecated
- //TODO: method needs to be optimized with a direct SQL query instead of iterating over all specimens
- public List<SpecimenOrObservationBase> findOccurrencesByType(IIdentifiableEntityServiceConfigurator configurator, SpecimenOrObservationType type){
- List<SpecimenOrObservationBase> filteredOccurrences = new ArrayList<SpecimenOrObservationBase>();
- List<SpecimenOrObservationBase> occurrences = findOccurrences(configurator, true);
- if(type!=null){
- for(SpecimenOrObservationBase occurrence:occurrences){
- if(occurrence.getRecordBasis().equals(type)
- || occurrence.getRecordBasis().isKindOf(type)
- || type == SpecimenOrObservationType.Unknown){
- filteredOccurrences.add(occurrence);
- }
- }
- }
- else{
- filteredOccurrences = occurrences;
- }
- return filteredOccurrences;
- }
-