return null;
}
- /**
- *
- *
- * @param uuid
- * @return
- */
public static Language getLanguageFromUuid(UUID uuid) {
if(termMap == null || termMap.isEmpty()) {
return getTermByClassAndUUID(Language.class, uuid);
}
}
-
// ******************************** toString *********************/
@Override
public String toString() {
return super.toString();
}
}
-
-}
+}
\ No newline at end of file
+ "]";
}
-
//*********************************** CLONE *****************************************/
/**
// Currently the CDM Caching mechanism is only used for caching terms
private static ICdmUuidCacher cacher;
-
/**
* Gets the CDM cacher object
*
public static <T extends DefinedTermBase> T getTermByClassAndUUID(Class<T> clazz, UUID uuid) {
if(cacher != null) {
- Object obj = HibernateProxyHelper.deproxy(getCacher().load(uuid));
+ CdmBase cdmBase = HibernateProxyHelper.deproxy(getCacher().load(uuid));
- if(obj != null && obj.getClass().equals(clazz)) {
- return (T)obj;
+ if(cdmBase != null && cdmBase.getClass().equals(clazz)) {
+ return (T)cdmBase;
}
}
return null;
useCategoryVocabulary.addTerm(useCategory2);
State useCategory3 = State.NewInstance("My 3rd use category", "use category 3", null);
useCategoryVocabulary.addTerm(useCategory3);
- List<State> newStates = new ArrayList<State>();
+ List<State> newStates = new ArrayList<>();
newStates.addAll(Arrays.asList(useCategory2, useCategory3));
// setting new states and thus removing useCategory1
*/
public abstract class CdmCacherBase implements ICdmUuidCacher {
- public static final Logger logger = LogManager.getLogger(CdmCacherBase.class);
+ public static final Logger logger = LogManager.getLogger();
@Autowired
public CacheManager cacheManager;
}
return cachedCdmEntity;
}
-}
+}
\ No newline at end of file
data.getStatisticalValues().clear();
for (StatisticalMeasurementValueDto dataDto: valueDtos){
//create new statedata
- StatisticalMeasurementValue newStatisticalMeasurement = StatisticalMeasurementValue.NewInstance(DefinedTermBase.getTermByClassAndUUID(StatisticalMeasure.class, dataDto.getType().getUuid()), dataDto.getValue());
+ StatisticalMeasure sm = DefinedTermBase.getTermByClassAndUUID(StatisticalMeasure.class, dataDto.getType().getUuid());
+ StatisticalMeasurementValue newStatisticalMeasurement = StatisticalMeasurementValue.NewInstance(sm, dataDto.getValue());
statisticalValues.add(newStatisticalMeasurement);
data.addStatisticalValue(newStatisticalMeasurement);
}
-// data.getStatisticalValues().addAll(statisticalValues);
+// data.getStatisticalValues().addAll(statisticalValues);
data = StructuredDescriptionAggregation.handleMissingMinOrMax(data,
MissingMinimumMode.MinToZero, MissingMaximumMode.MaxToMin);
desc.addElement(data);
desc.removeElement(data);
}else{
for (StateDataDto dataDto: stateDtos){
- //FIXME 10196
- State newState = DefinedTermBase.getTermByClassAndUUID(State.class, dataDto.getState().getUuid());
+ //FIXME 10196 fixed
+ DefinedTermBase<?> newState = DefinedTermBase.getTermByUUID(dataDto.getState().getUuid(), DefinedTermBase.class);
StateData newStateData = StateData.NewInstance(newState);
data.addStateData(newStateData);
}
}
-
}else if (elementBase.isInstanceOf(QuantitativeData.class)){
QuantitativeData data = HibernateProxyHelper.deproxy(elementBase, QuantitativeData.class);
result.addUpdatedObject(taxon);
}
-
-
UUID specimenDescriptionUuid = wrapper.getDescription().getDescriptionUuid();
DescriptionBaseDto descriptionDto = wrapper.getDescription();
DescriptionBase<?> specimenDescription = descriptionService.load(specimenDescriptionUuid);
}
}
}
-
}else {
List<DescriptionElementDto> elementDtos = descriptionDto.getElements();
for (DescriptionElementDto elementDto: elementDtos){
categoricalData.setStateDataOnly(states);
}
}
-
}else{
Feature feature = DefinedTermBase.getTermByClassAndUUID(Feature.class, featureUuid);
if (feature == null){
quantitativeData = (QuantitativeDataDto)dto;
}
}
-
-
}
if (quantitativeData == null){
//TODO: check whether this is possible
public SpecimenRowWrapperDTO(SpecimenOrObservationBase specimen, TaxonNodeDto taxonNode, UuidAndTitleCache<FieldUnit> fieldUnit, String identifier,
NamedArea country) {
- super(new DescriptionBaseDto(new UuidAndTitleCache<SpecimenOrObservationBase>(specimen.getUuid(), specimen.getId(), specimen.getTitleCache())), taxonNode);
- if (fieldUnit != null){
- this.fieldUnit = fieldUnit;
- }
- this.identifier = identifier;
- this.country = country;
- this.specimenDto = SpecimenOrObservationDTOFactory.fromEntity(specimen);
- this.type = specimen.getRecordBasis();
+ super(new DescriptionBaseDto(new UuidAndTitleCache<SpecimenOrObservationBase>(specimen.getUuid(), specimen.getId(), specimen.getTitleCache())), taxonNode);
+ if (fieldUnit != null){
+ this.fieldUnit = fieldUnit;
+ }
+ this.identifier = identifier;
+ this.country = country;
+ this.specimenDto = SpecimenOrObservationDTOFactory.fromEntity(specimen);
+ this.type = specimen.getRecordBasis();
-}
+ }
public SpecimenOrObservationBaseDTO getSpecimenDto() {
return specimenDto;
}