[Dive4elements-commits] [PATCH 2 of 7] Backed out changeset 53fca3392c9f

Wald Commits scm-commit at wald.intevation.org
Wed Jun 5 13:20:04 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1369405601 -7200
# Node ID dc166b225775a7de31a8a3cdf4514d16727b46fd
# Parent  53fca3392c9fd35743e4a886f21c64c4d7c179f2
Backed out changeset 53fca3392c9f

diff -r 53fca3392c9f -r dc166b225775 backend/doc/schema/oracle-minfo.sql
--- a/backend/doc/schema/oracle-minfo.sql	Fri May 24 16:03:52 2013 +0200
+++ b/backend/doc/schema/oracle-minfo.sql	Fri May 24 16:26:41 2013 +0200
@@ -85,12 +85,12 @@
 CREATE TABLE bed_height_single_values (
     id                      NUMBER(38,0) NOT NULL,
     bed_height_single_id    NUMBER(38,0) NOT NULL,
-    station                 DOUBLE PRECISION NOT NULL,
-    height                  DOUBLE PRECISION,
-    uncertainty             DOUBLE PRECISION,
-    data_gap                DOUBLE PRECISION,
-    sounding_width          DOUBLE PRECISION,
-    width                   DOUBLE PRECISION,
+    station                 NUMBER(38,2) NOT NULL,
+    height                  NUMBER(38,2),
+    uncertainty             NUMBER(38,2),
+    data_gap                NUMBER(38,2),
+    sounding_width          NUMBER(38,2),
+    width                   NUMBER(38,2),
     PRIMARY KEY(id),
     UNIQUE (station, bed_height_single_id),
     CONSTRAINT fk_bed_single_values_parent FOREIGN KEY (bed_height_single_id) REFERENCES bed_height_single(id) ON DELETE CASCADE
diff -r 53fca3392c9f -r dc166b225775 backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java	Fri May 24 16:03:52 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java	Fri May 24 16:26:41 2013 +0200
@@ -29,24 +29,24 @@
 
     protected ImportBedHeightSingle bedHeight;
 
-    protected Double station;
-    protected Double height;
-    protected Double uncertainty;
-    protected Double dataGap;
+    protected BigDecimal station;
+    protected BigDecimal height;
+    protected BigDecimal uncertainty;
+    protected BigDecimal dataGap;
     protected BigDecimal soundingWidth;
-    protected Double width;
+    protected BigDecimal width;
 
     protected BedHeightSingleValue peer;
 
 
     public ImportBedHeightSingleValue(
         ImportBedHeightSingle bedHeight,
-        Double station,
-        Double height,
-        Double uncertainty,
-        Double dataGap,
+        BigDecimal station,
+        BigDecimal height,
+        BigDecimal uncertainty,
+        BigDecimal dataGap,
         BigDecimal soundingWidth,
-        Double width
+        BigDecimal width
     ) {
         this.bedHeight     = bedHeight;
         this.station       = station;
diff -r 53fca3392c9f -r dc166b225775 backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java	Fri May 24 16:03:52 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java	Fri May 24 16:26:41 2013 +0200
@@ -46,10 +46,10 @@
             return;
         }
 
-        Double km;
+        BigDecimal km;
 
         try {
-            km = new Double(nf.parse(values[0]).doubleValue());
+            km = new BigDecimal(nf.parse(values[0]).doubleValue());
         }
         catch (ParseException e) {
             // We expect a lot of ";;;;;;" lines.
@@ -76,11 +76,11 @@
             ImportBedHeightSingleValue value = new ImportBedHeightSingleValue(
                 (ImportBedHeightSingle) obj,
                 km,
-                new Double(nf.parse(values[1]).doubleValue()),
-                new Double(nf.parse(values[2]).doubleValue()),
-                new Double(nf.parse(values[3]).doubleValue()),
+                new BigDecimal(nf.parse(values[1]).doubleValue()),
+                new BigDecimal(nf.parse(values[2]).doubleValue()),
+                new BigDecimal(nf.parse(values[3]).doubleValue()),
                 parseBigDecimal(values[4], line),
-                new Double(nf.parse(values[5]).doubleValue())
+                new BigDecimal(nf.parse(values[5]).doubleValue())
             );
 
             obj.addValue(value);
diff -r 53fca3392c9f -r dc166b225775 backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java	Fri May 24 16:03:52 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java	Fri May 24 16:26:41 2013 +0200
@@ -43,12 +43,12 @@
 
     private BedHeightSingle bedHeight;
 
-    private Double station;
-    private Double height;
-    private Double uncertainty;
-    private Double dataGap;
+    private BigDecimal station;
+    private BigDecimal height;
+    private BigDecimal uncertainty;
+    private BigDecimal dataGap;
     private BigDecimal soundingWidth;
-    private Double width;
+    private BigDecimal width;
 
 
     public BedHeightSingleValue() {
@@ -56,12 +56,12 @@
 
     public BedHeightSingleValue(
         BedHeightSingle bedHeight,
-        Double station,
-        Double height,
-        Double uncertainty,
-        Double dataGap,
+        BigDecimal station,
+        BigDecimal height,
+        BigDecimal uncertainty,
+        BigDecimal dataGap,
         BigDecimal soundingWidth,
-        Double width
+        BigDecimal width
     ) {
         this.bedHeight     = bedHeight;
         this.station       = station;
@@ -100,38 +100,38 @@
     }
 
     @Column(name = "station")
-    public Double getStation() {
+    public BigDecimal getStation() {
         return station;
     }
 
-    public void setStation(Double station) {
+    public void setStation(BigDecimal station) {
         this.station = station;
     }
 
     @Column(name = "height")
-    public Double getHeight() {
+    public BigDecimal getHeight() {
         return height;
     }
 
-    public void setHeight(Double height) {
+    public void setHeight(BigDecimal height) {
         this.height = height;
     }
 
     @Column(name="uncertainty")
-    public Double getUncertainty() {
+    public BigDecimal getUncertainty() {
         return uncertainty;
     }
 
-    public void setUncertainty(Double uncertainty) {
+    public void setUncertainty(BigDecimal uncertainty) {
         this.uncertainty = uncertainty;
     }
 
     @Column(name="data_gap")
-    public Double getDataGap() {
+    public BigDecimal getDataGap() {
         return dataGap;
     }
 
-    public void setDataGap(Double dataGap) {
+    public void setDataGap(BigDecimal dataGap) {
         this.dataGap = dataGap;
     }
 
@@ -145,11 +145,11 @@
     }
 
     @Column(name="width")
-    public Double getWidth() {
+    public BigDecimal getWidth() {
         return width;
     }
 
-    public void setWidth(Double width) {
+    public void setWidth(BigDecimal width) {
         this.width = width;
     }
 
@@ -166,8 +166,8 @@
             "   and station >= :kmLo and station <= :kmHi");
 
         query.setParameter("single", single);
-        query.setParameter("kmLo", new Double(kmLo));
-        query.setParameter("kmHi", new Double(kmHi));
+        query.setParameter("kmLo", new BigDecimal(kmLo));
+        query.setParameter("kmHi", new BigDecimal(kmHi));
 
         return query.list();
     }


More information about the Dive4elements-commits mailing list