changeset 2825:a948366d8ac5

Added new model classes for MINFO specific flow velocity. flys-backend/trunk@4242 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 17 Apr 2012 06:36:39 +0000
parents 85b2b5e7377f
children c3f8cf0cdf69
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java flys-backend/src/main/java/de/intevation/flys/model/DischargeZone.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModel.java flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModelValue.java
diffstat 5 files changed, 360 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Mon Apr 16 09:48:49 2012 +0000
+++ b/flys-backend/ChangeLog	Tue Apr 17 06:36:39 2012 +0000
@@ -1,3 +1,13 @@
+2012-04-17  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/model/FlowVelocityModel.java,
+	  src/main/java/de/intevation/flys/model/FlowVelocityModelValue.java,
+	  src/main/java/de/intevation/flys/model/DischargeZone.java: New model
+	  classes for MINFO specific database relations.
+
+	* src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java:
+	  Registered the new model classes.
+
 2012-04-16  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/schema/oracle-minfo.sql,
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Mon Apr 16 09:48:49 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Tue Apr 17 06:36:39 2012 +0000
@@ -39,11 +39,14 @@
 import de.intevation.flys.model.DGM;
 import de.intevation.flys.model.DischargeTable;
 import de.intevation.flys.model.DischargeTableValue;
+import de.intevation.flys.model.DischargeZone;
 import de.intevation.flys.model.Edge;
 import de.intevation.flys.model.ElevationModel;
 import de.intevation.flys.model.Fixpoint;
 import de.intevation.flys.model.Floodmaps;
 import de.intevation.flys.model.Floodplain;
+import de.intevation.flys.model.FlowVelocityModel;
+import de.intevation.flys.model.FlowVelocityModelValue;
 import de.intevation.flys.model.Gauge;
 import de.intevation.flys.model.Hws;
 import de.intevation.flys.model.HYK;
@@ -240,11 +243,14 @@
         cfg.addAnnotatedClass(DGM.class);
         cfg.addAnnotatedClass(DischargeTable.class);
         cfg.addAnnotatedClass(DischargeTableValue.class);
+        cfg.addAnnotatedClass(DischargeZone.class);
         cfg.addAnnotatedClass(Edge.class);
         cfg.addAnnotatedClass(ElevationModel.class);
         cfg.addAnnotatedClass(Fixpoint.class);
         cfg.addAnnotatedClass(Floodplain.class);
         cfg.addAnnotatedClass(Floodmaps.class);
+        cfg.addAnnotatedClass(FlowVelocityModel.class);
+        cfg.addAnnotatedClass(FlowVelocityModelValue.class);
         cfg.addAnnotatedClass(Gauge.class);
         cfg.addAnnotatedClass(Hws.class);
         cfg.addAnnotatedClass(HYK.class);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/DischargeZone.java	Tue Apr 17 06:36:39 2012 +0000
@@ -0,0 +1,122 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Column;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.GenerationType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+
+import org.apache.log4j.Logger;
+
+
+@Entity
+@Table(name = "discharge_zone")
+public class DischargeZone
+implements   Serializable
+{
+    private static Logger logger = Logger.getLogger(DischargeZone.class);
+
+
+    private Integer id;
+
+    private String gaugeName;
+
+    private River river;
+
+    private NamedMainValue mainValue;
+
+    private BigDecimal lowerFactor;
+
+    private BigDecimal upperFactor;
+
+
+    public DischargeZone() {
+    }
+
+
+    public DischargeZone(
+        String         gaugeName,
+        River          river,
+        NamedMainValue mainValue,
+        BigDecimal     lowerFactor,
+        BigDecimal     upperFactor
+    ) {
+        this.gaugeName   = gaugeName;
+        this.river       = river;
+        this.mainValue   = mainValue;
+        this.lowerFactor = lowerFactor;
+        this.upperFactor = upperFactor;
+    }
+
+    @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_DISCHARGE_ZONE_ID_SEQ",
+        sequenceName   = "DISCHARGE_ZONE_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_DISCHARGE_ZONE_ID_SEQ")
+    @Column(name = "id")
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "river_id" )
+    public River getRiver() {
+        return river;
+    }
+
+    public void setRiver(River river) {
+        this.river = river;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "named_main_value_id")
+    public NamedMainValue getMainValue() {
+        return mainValue;
+    }
+
+    public void setMainValue(NamedMainValue mainValue) {
+        this.mainValue = mainValue;
+    }
+
+    @Column(name = "gauge_name")
+    public String getGaugeName() {
+        return gaugeName;
+    }
+
+    public void setGaugeName(String gaugeName) {
+        this.gaugeName = gaugeName;
+    }
+
+    @Column(name = "lower_factor")
+    public BigDecimal getLowerFactor() {
+        return lowerFactor;
+    }
+
+    public void setLowerFactor(BigDecimal lowerFactor) {
+        this.lowerFactor = lowerFactor;
+    }
+
+    @Column(name = "upper_factor")
+    public BigDecimal getUpperFactor() {
+        return upperFactor;
+    }
+
+    public void setUpperFactor(BigDecimal upperFactor) {
+        this.upperFactor = upperFactor;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModel.java	Tue Apr 17 06:36:39 2012 +0000
@@ -0,0 +1,103 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Column;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.GenerationType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+
+import org.apache.log4j.Logger;
+
+
+@Entity
+@Table(name = "flow_velocity_model")
+public class FlowVelocityModel
+implements   Serializable
+{
+    private static Logger logger = Logger.getLogger(FlowVelocityModel.class);
+
+
+    private Integer id;
+
+    private River river;
+
+    private DischargeZone dischargeZone;
+
+    private List<FlowVelocityModelValue> values;
+
+    private String description;
+
+
+    public FlowVelocityModel() {
+    }
+
+
+    public FlowVelocityModel(River river, DischargeZone dischargeZone) {
+        this(river, dischargeZone, null);
+    }
+
+
+    public FlowVelocityModel(
+        River         river,
+        DischargeZone dischargeZone,
+        String        description
+    ) {
+        this.river         = river;
+        this.dischargeZone = dischargeZone;
+        this.description   = description;
+    }
+
+    @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ",
+        sequenceName   = "FLOW_VELOCITY_MODEL_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ")
+    @Column(name = "id")
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "river_id")
+    public River getRiver() {
+        return river;
+    }
+
+    public void setRiver(River river) {
+        this.river = river;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "discharge_zone_id")
+    public DischargeZone getDischargeZone() {
+        return dischargeZone;
+    }
+
+    public void setDischargeZone(DischargeZone dischargeZone) {
+        this.dischargeZone = dischargeZone;
+    }
+
+    @Column(name = "description")
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModelValue.java	Tue Apr 17 06:36:39 2012 +0000
@@ -0,0 +1,119 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Column;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.GenerationType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+
+import org.apache.log4j.Logger;
+
+
+@Entity
+@Table(name = "flow_velocity_model_values")
+public class FlowVelocityModelValue
+implements   Serializable
+{
+    private static Logger logger =
+        Logger.getLogger(FlowVelocityModelValue.class);
+
+
+    private Integer id;
+
+    private FlowVelocityModel flowVelocity;
+
+    private BigDecimal station;
+    private BigDecimal totalChannel;
+    private BigDecimal mainChannel;
+    private BigDecimal shearStress;
+
+
+    public FlowVelocityModelValue() {
+    }
+
+
+    public FlowVelocityModelValue(
+        FlowVelocityModel flowVelocity,
+        BigDecimal        station,
+        BigDecimal        totalChannel,
+        BigDecimal        mainChannel,
+        BigDecimal        shearStress
+    ) {
+        this.flowVelocity = flowVelocity;
+        this.station      = station;
+        this.totalChannel = totalChannel;
+        this.mainChannel  = mainChannel;
+        this.shearStress  = shearStress;
+    }
+
+    @Id
+    @SequenceGenerator(
+        name           = "SEQUENCE_FLOW_VELOCITY_M_VALUES_ID_SEQ",
+        sequenceName   = "FLOW_VELOCITY_M_VALUES_ID_SEQ",
+        allocationSize = 1)
+    @GeneratedValue(
+        strategy  = GenerationType.SEQUENCE,
+        generator = "SEQUENCE_FLOW_VELOCITY_M_VALUES_ID_SEQ")
+    @Column(name = "id")
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @OneToOne
+    @JoinColumn(name = "flow_velocity_model_id")
+    public FlowVelocityModel getFlowVelocity() {
+        return flowVelocity;
+    }
+
+    public void setFlowVelocity(FlowVelocityModel flowVelocity) {
+        this.flowVelocity = flowVelocity;
+    }
+
+    @Column(name = "station")
+    public BigDecimal getStation() {
+        return station;
+    }
+
+    public void setStation(BigDecimal station) {
+        this.station = station;
+    }
+
+    @Column(name = "total_channel")
+    public BigDecimal getTotalChannel() {
+        return totalChannel;
+    }
+
+    public void setTotalChannel(BigDecimal totalChannel) {
+        this.totalChannel = totalChannel;
+    }
+
+    @Column(name = "main_channel")
+    public BigDecimal getMainChannel() {
+        return mainChannel;
+    }
+
+    public void setMainChannel(BigDecimal mainChannel) {
+        this.mainChannel = mainChannel;
+    }
+
+    @Column(name = "shear_stress")
+    public BigDecimal getShearStress() {
+        return shearStress;
+    }
+
+    public void setShearStress(BigDecimal shearStress) {
+        this.shearStress = shearStress;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org