diff backend/src/main/java/org/dive4elements/river/model/sinfo/BedMobilityValue.java @ 8971:50416a0df385

Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author mschaefer
date Tue, 03 Apr 2018 10:18:30 +0200
parents
children 6e5ff436febe
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/src/main/java/org/dive4elements/river/model/sinfo/BedMobilityValue.java	Tue Apr 03 10:18:30 2018 +0200
@@ -0,0 +1,109 @@
+/* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
+ *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.model.sinfo;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+
+/**
+ * Hibernate binding for the DB table bed_mobility_values
+ *
+ * @author Matthias Schäfer
+ *
+ */
+@Entity
+@Table(name = "bed_mobility_values")
+public class BedMobilityValue implements Serializable {
+
+    /***** FIELDS *****/
+
+    private static final long serialVersionUID = 1784382276688203055L;
+
+    private Integer id;
+
+    private BedMobility bedMobility;
+
+    private Double station;
+
+    private int moving; /* 0 or 1 */
+
+
+    /***** CONSTRUCTORS *****/
+
+    public BedMobilityValue() {
+    }
+
+    public BedMobilityValue(final BedMobility bedMobility, final Double station, final int bedMoving) {
+        this.bedMobility = bedMobility;
+        this.station = station;
+        this.moving = bedMoving;
+    }
+
+    /**
+     * Parameter constructor with primitive double km and boolean
+     */
+    public BedMobilityValue(final BedMobility bedMobility, final double km, final boolean bedMoving) {
+        this(bedMobility, Double.valueOf(km), (bedMoving ? 1 : 0));
+    }
+
+
+    /***** METHODS *****/
+
+    @Id
+    @SequenceGenerator(name = "SEQUENCE_BED_MOBILITY_VALUE_ID_SEQ", sequenceName = "BED_MOBILITY_VALUES_ID_SEQ", allocationSize = 1)
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_BED_MOBILITY_VALUE_ID_SEQ")
+    @Column(name = "id")
+    public Integer getId() {
+        return this.id;
+    }
+
+    public void setId(final Integer id) {
+        this.id = id;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "bed_mobility_id")
+    public BedMobility getBedMobility() {
+        return this.bedMobility;
+    }
+
+    public void setBedMobility(final BedMobility bedMobility) {
+        this.bedMobility = bedMobility;
+    }
+
+    @Column(name = "station")
+    public Double getStation() {
+        return this.station;
+    }
+
+    public void setStation(final Double station) {
+        this.station = station;
+    }
+
+    @Column(name = "moving")
+    public int getMoving() {
+        return this.moving;
+    }
+
+    public void setMoving(final int bedMoving) {
+        this.moving = bedMoving;
+    }
+}

http://dive4elements.wald.intevation.org