Skip to content

Commit f9d0e93

Browse files
committed
fix EReporting dataCapture/uncertaintyEstimation data type
there is a mismatch between the Hibernate XML-Mapping that specifies dataCapture/uncertaintyEstimation as big_decimal and the POJO Beans that specify it as double. In SOS 4.x the database fields were defined as `double`, with the introduction of sensorweb-server-db-model they were redefined without adjusting the Beans.
1 parent b954d74 commit f9d0e93

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingProfileDataEntity.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.HasValidation;
2222
import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.HasVerification;
2323

24+
import java.math.BigDecimal;
25+
2426
public class EReportingProfileDataEntity
2527
implements HasValidation, HasVerification, HasPrimaryObservation, HasDataCapture, EReportingQualityData {
2628

@@ -34,9 +36,9 @@ public class EReportingProfileDataEntity
3436

3537
private Boolean dataCaptureFlag;
3638

37-
private Double dataCapture;
39+
private BigDecimal dataCapture;
3840

39-
private Double uncertaintyEstimation;
41+
private BigDecimal uncertaintyEstimation;
4042

4143
public Integer getVerification() {
4244
return verification;
@@ -70,11 +72,11 @@ public void setDataCaptureFlag(Boolean dataCaptureFlag) {
7072
this.dataCaptureFlag = dataCaptureFlag;
7173
}
7274

73-
public Double getDataCapture() {
75+
public BigDecimal getDataCapture() {
7476
return this.dataCapture;
7577
}
7678

77-
public void setDataCapture(Double dataCapture) {
79+
public void setDataCapture(BigDecimal dataCapture) {
7880
this.dataCapture = dataCapture;
7981
}
8082

@@ -86,11 +88,11 @@ public void setTimeCoverageFlag(Boolean timeCoverageFlag) {
8688
this.timeCoverageFlag = timeCoverageFlag;
8789
}
8890

89-
public Double getUncertaintyEstimation() {
91+
public BigDecimal getUncertaintyEstimation() {
9092
return this.uncertaintyEstimation;
9193
}
9294

93-
public void setUncertaintyEstimation(Double uncertaintyEstimation) {
95+
public void setUncertaintyEstimation(BigDecimal uncertaintyEstimation) {
9496
this.uncertaintyEstimation = uncertaintyEstimation;
9597
}
9698

entities/src/main/java/org/n52/series/db/beans/ereporting/EReportingQualityEntity.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.EReportingQualityData;
2020
import org.n52.series.db.beans.ereporting.HiberanteEReportingRelations.HasPrimaryObservation;
2121

22+
import java.math.BigDecimal;
23+
2224
public class EReportingQualityEntity extends IdEntity implements HasPrimaryObservation, EReportingQualityData {
2325

2426
public static final String YEAR = "year";
@@ -41,7 +43,7 @@ public class EReportingQualityEntity extends IdEntity implements HasPrimaryObser
4143

4244
private Boolean dataCaptureFlag;
4345

44-
private Double uncertaintyEstimation;
46+
private BigDecimal uncertaintyEstimation;
4547

4648
/**
4749
* @return the dataset
@@ -119,12 +121,12 @@ public void setTimeCoverageFlag(Boolean timeCoverageFlag) {
119121
}
120122

121123
@Override
122-
public Double getUncertaintyEstimation() {
124+
public BigDecimal getUncertaintyEstimation() {
123125
return this.uncertaintyEstimation;
124126
}
125127

126128
@Override
127-
public void setUncertaintyEstimation(Double uncertaintyEstimation) {
129+
public void setUncertaintyEstimation(BigDecimal uncertaintyEstimation) {
128130
this.uncertaintyEstimation = uncertaintyEstimation;
129131
}
130132
}

entities/src/main/java/org/n52/series/db/beans/ereporting/HiberanteEReportingRelations.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import org.n52.series.db.beans.HibernateRelations;
1919

20+
import java.math.BigDecimal;
21+
2022
public interface HiberanteEReportingRelations extends HibernateRelations {
2123

2224
interface HasInspireId {
@@ -103,9 +105,9 @@ interface HasDataCapture {
103105

104106
String DATA_CAPTURE = "dataCapture";
105107

106-
Double getDataCapture();
108+
BigDecimal getDataCapture();
107109

108-
void setDataCapture(Double dataCapture);
110+
void setDataCapture(BigDecimal dataCapture);
109111

110112
default boolean isSetDataCapture() {
111113
return getDataCapture() != null;
@@ -115,9 +117,9 @@ default boolean isSetDataCapture() {
115117
interface HasUncertaintyEstimation {
116118
String UNCERTAINTY_ESTIMATION = "uncertaintyEstimation";
117119

118-
Double getUncertaintyEstimation();
120+
BigDecimal getUncertaintyEstimation();
119121

120-
void setUncertaintyEstimation(Double uncertaintyEstimation);
122+
void setUncertaintyEstimation(BigDecimal uncertaintyEstimation);
121123

122124
default boolean isSetUncertaintyEstimation() {
123125
return getUncertaintyEstimation() != null;

0 commit comments

Comments
 (0)