changeset 167:15d515fe15f5

Added POJOs to be mapped to schema. flys-backend/trunk@1456 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 10 Mar 2011 13:44:51 +0000
parents 56eb8f1b42cf
children 86a1bd9cc50e
files flys-backend/ChangeLog flys-backend/doc/schema/postgresql.sql flys-backend/doc/schema/sqlite.sql flys-backend/pom.xml flys-backend/src/main/java/de/intevation/flys/model/Annotation.java flys-backend/src/main/java/de/intevation/flys/model/Attribute.java flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java flys-backend/src/main/java/de/intevation/flys/model/DischargeTableValue.java flys-backend/src/main/java/de/intevation/flys/model/Gauge.java flys-backend/src/main/java/de/intevation/flys/model/MainValueType.java flys-backend/src/main/java/de/intevation/flys/model/NamedMainValues.java flys-backend/src/main/java/de/intevation/flys/model/Position.java flys-backend/src/main/java/de/intevation/flys/model/Range.java flys-backend/src/main/java/de/intevation/flys/model/River.java flys-backend/src/main/java/de/intevation/flys/model/TimeInterval.java flys-backend/src/main/java/de/intevation/flys/model/Wst.java flys-backend/src/main/java/de/intevation/flys/model/WstColumn.java flys-backend/src/main/java/de/intevation/flys/model/WstColumnQRange.java flys-backend/src/main/java/de/intevation/flys/model/WstColumnValue.java flys-backend/src/main/java/de/intevation/flys/model/WstQRange.java
diffstat 20 files changed, 725 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Wed Mar 09 15:24:57 2011 +0000
+++ b/flys-backend/ChangeLog	Thu Mar 10 13:44:51 2011 +0000
@@ -1,3 +1,13 @@
+2011-03-11	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/schema/sqlite.sql, doc/schema/postgresql.sql: Fixed
+	  smaller issues in ddl.
+
+	* src/main/java/de/intevation/flys/model/*.java: Added POJOs
+	  of to be mapped. TODO: Map them!
+
+	* pom.xml: Added plugin config for hibernate.
+
 2011-03-09	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* pom.xml: Added dependency (and corresponding repository) to
--- a/flys-backend/doc/schema/postgresql.sql	Wed Mar 09 15:24:57 2011 +0000
+++ b/flys-backend/doc/schema/postgresql.sql	Thu Mar 10 13:44:51 2011 +0000
@@ -49,7 +49,8 @@
     -- Streckengueltigkeit
     range_id     int NOT NULL REFERENCES ranges (id),
 
-    UNIQUE (name, river_id)
+    UNIQUE (name, river_id),
+    UNIQUE (river_id, datum)
 );
 
 -- Type of a Hauptwert 'W', 'Q', 'D', etc.
@@ -88,7 +89,7 @@
 );
 
 -- Abflusstafeln
-CREATE TABLE discharge_table (
+CREATE TABLE discharge_tables (
     id               int PRIMARY KEY NOT NULL,
     gauge_id         int NOT NULL REFERENCES gauges(id),
 
@@ -101,7 +102,7 @@
 -- Values of the Abflusstafeln
 CREATE TABLE discharge_table_values (
     id             int PRIMARY KEY NOT NULL,
-    table_id       int NOT NULL REFERENCES discharge_table(id),
+    table_id       int NOT NULL REFERENCES discharge_tables(id),
     q              NUMERIC NOT NULL,
     w              NUMERIC NOT NULL,
 
--- a/flys-backend/doc/schema/sqlite.sql	Wed Mar 09 15:24:57 2011 +0000
+++ b/flys-backend/doc/schema/sqlite.sql	Thu Mar 10 13:44:51 2011 +0000
@@ -49,7 +49,8 @@
     -- Streckengueltigkeit
     range_id     INTEGER NOT NULL REFERENCES ranges (id),
 
-    UNIQUE (name, river_id)
+    UNIQUE (name, river_id),
+    UNIQUE (river_id, datum)
 );
 
 -- Type of a Hauptwert 'W', 'Q', 'D', etc.
@@ -88,7 +89,7 @@
 );
 
 -- Abflusstafeln
-CREATE TABLE discharge_table (
+CREATE TABLE discharge_tables (
     id               INTEGER PRIMARY KEY NOT NULL,
     gauge_id         INTEGER NOT NULL REFERENCES gauges(id),
 
@@ -101,7 +102,7 @@
 -- Values of the Abflusstafeln
 CREATE TABLE discharge_table_values (
     id             INTEGER PRIMARY KEY NOT NULL,
-    table_id       INTEGER NOT NULL REFERENCES discharge_table(id),
+    table_id       INTEGER NOT NULL REFERENCES discharge_tables(id),
     q              NUMERIC NOT NULL,
     w              NUMERIC NOT NULL,
 
--- a/flys-backend/pom.xml	Wed Mar 09 15:24:57 2011 +0000
+++ b/flys-backend/pom.xml	Thu Mar 10 13:44:51 2011 +0000
@@ -14,6 +14,23 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>hibernate3-maven-plugin</artifactId>
+        <version>2.2</version>
+        <!--
+        <configuration>
+            <componentProperties>
+                <propertyfile>src/main/config/hbm.properties</propertyfile>
+            </componentProperties>
+        </configuration>
+        -->
+      </plugin>
+    </plugins>
+  </build>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/Annotation.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,48 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class Annotation
+implements   Serializable
+{
+    private Long       id;
+    private Range      range;
+    private Attribute  attribute;
+    private Position   position;
+
+    public Annotation() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRange(Range range) {
+        this.range = range;
+    }
+
+    public Range getRange() {
+        return range;
+    }
+
+    public void setAttribute(Attribute attribute) {
+        this.attribute = attribute;
+    }
+
+    public Attribute getAttribute() {
+        return attribute;
+    }
+
+    public void setPosition(Position position) {
+        this.position = position;
+    }
+
+    public Position getPosition() {
+        return position;
+    }
+}
+// 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/Attribute.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,31 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class Attribute
+implements   Serializable
+{
+    private Long   id;
+
+    private String value;
+
+    public Attribute() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}
+// 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/DischargeTable.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,39 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class DischargeTable
+implements   Serializable
+{
+    private Long         id;
+    private Gauge        gauge;
+    private TimeInterval timeInterval;
+
+    public DischargeTable() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setTimeInterval(TimeInterval timeInterval) {
+        this.timeInterval = timeInterval;
+    }
+
+    public TimeInterval getTimeInterval() {
+        return timeInterval;
+    }
+
+    public void setGauge(Gauge gauge) {
+        this.gauge = gauge;
+    }
+
+    public Gauge getGauge() {
+        return gauge;
+    }
+}
+// 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/DischargeTableValue.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,50 @@
+package de.intevation.flys.model;
+
+import java.math.BigDecimal;
+
+import java.io.Serializable;
+
+public class DischargeTableValue
+implements   Serializable
+{
+    private Long           id;
+    private DischargeTable dischargeTable;
+    private BigDecimal     q;
+    private BigDecimal     w;
+
+    public DischargeTableValue() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setDischargeTable(DischargeTable dischargeTable) {
+        this.dischargeTable = dischargeTable;
+    }
+
+    public DischargeTable getDischargeTable() {
+        return dischargeTable;
+    }
+
+    public void setQ(BigDecimal q) {
+        this.q = q;
+    }
+
+    public BigDecimal getQ() {
+        return q;
+    }
+
+    public void setW(BigDecimal w) {
+        this.w = w;
+    }
+
+    public BigDecimal getW() {
+        return w;
+    }
+}
+// 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/Gauge.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,69 @@
+package de.intevation.flys.model;
+
+import java.math.BigDecimal;
+
+import java.io.Serializable;
+
+public class Gauge
+implements   Serializable
+{
+    private Long       id;
+    private String     name;
+    private River      river;
+    private BigDecimal station;
+    private BigDecimal aeo;
+    private BigDecimal datum;
+    private Range      range;
+
+    public Gauge() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setStation(BigDecimal station) {
+        this.station = station;
+    }
+
+    public BigDecimal getStation() {
+        return station;
+    }
+
+    public void setAeo(BigDecimal aeo) {
+        this.aeo = aeo;
+    }
+
+    public BigDecimal getAeo() {
+        return aeo;
+    }
+
+    public void setDatum(BigDecimal datum) {
+        this.datum = datum;
+    }
+
+    public BigDecimal getDatum() {
+        return datum;
+    }
+
+    public void setRange(Range range) {
+        this.range = range;
+    }
+
+    public Range getRange() {
+        return range;
+    }
+}
+// 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/MainValueType.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,31 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class MainValueType
+implements   Serializable
+{
+    private Long   id;
+
+    private String value;
+
+    public MainValueType() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}
+// 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/NamedMainValues.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,39 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class NamedMainValues
+implements   Serializable
+{
+    private Long          id;
+    private String        name;
+    private MainValueType type;
+
+    public NamedMainValues() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setType(MainValueType type) {
+        this.type = type;
+    }
+
+    public MainValueType getType() {
+        return type;
+    }
+}
+// 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/Position.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,31 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class Position
+implements   Serializable
+{
+    private Long   id;
+
+    private String value;
+
+    public Position() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}
+// 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/Range.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,51 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+public class Range
+implements   Serializable
+{
+    private Long       id;
+    private BigDecimal a;
+    private BigDecimal b;
+
+    private River      river;
+
+    public Range() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setA(BigDecimal a) {
+        this.a = a;
+    }
+
+    public BigDecimal getA() {
+        return a;
+    }
+
+    public void setB(BigDecimal b) {
+        this.b = b;
+    }
+
+    public BigDecimal getB() {
+        return b;
+    }
+
+    public void setRiver(River river) {
+        this.river = river;
+    }
+
+    public River getRiver() {
+        return river;
+    }
+}
+// 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/River.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,31 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class River
+implements   Serializable
+{
+    private Long   id;
+
+    private String name;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public River() {
+    }
+}
+// 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/TimeInterval.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,41 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+import java.util.Date;
+
+public class TimeInterval
+implements   Serializable
+{
+    private Long id;
+    private Date startTime;
+    private Date stopTime;
+
+    public TimeInterval() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStopTime(Date stopTime) {
+        this.stopTime = stopTime;
+    }
+
+    public Date getStopTime() {
+        return stopTime;
+    }
+}
+// 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/Wst.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,39 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class Wst
+implements   Serializable
+{
+    private Long   id;
+    private River  river;
+    private String description;
+
+    public Wst() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRiver(River river) {
+        this.river = river;
+    }
+
+    public River getRiver() {
+        return river;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return 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/WstColumn.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,57 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+
+public class WstColumn
+implements   Serializable
+{
+    private Long         id;
+    private Wst          wst;
+    private String       name;
+    private String       description;
+    private TimeInterval timeInterval;
+
+    public WstColumn() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setWst(Wst wst) {
+        this.wst = wst;
+    }
+
+    public Wst getWst() {
+        return wst;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setTimeInterval(TimeInterval timeInterval) {
+        this.timeInterval = timeInterval;
+    }
+
+    public TimeInterval getTimeInterval() {
+        return timeInterval;
+    }
+}
+// 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/WstColumnQRange.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,42 @@
+package de.intevation.flys.model;
+
+import java.math.BigDecimal;
+
+import java.io.Serializable;
+
+public class WstColumnQRange
+implements   Serializable
+{
+    private Long      id;
+    private WstColumn wstColumn;
+    private WstQRange wstQRange;
+
+    public WstColumnQRange() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setWstColumn(WstColumn wstColumn) {
+        this.wstColumn = wstColumn;
+    }
+
+    public WstColumn getWstColumn() {
+        return wstColumn;
+    }
+
+    public void setWstQRange(WstQRange wstQRange) {
+        this.wstQRange = wstQRange;
+    }
+
+    public WstQRange getWstQRange() {
+        return wstQRange;
+    }
+}
+// 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/WstColumnValue.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,50 @@
+package de.intevation.flys.model;
+
+import java.math.BigDecimal;
+
+import java.io.Serializable;
+
+public class WstColumnValue
+implements   Serializable
+{
+    private Long       id;
+    private WstColumn  wstColumn;
+    private Position   position;
+    private BigDecimal w;
+
+    public WstColumnValue() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setWstColumn(WstColumn wstColumn) {
+        this.wstColumn = wstColumn;
+    }
+
+    public WstColumn getWstColumn() {
+        return wstColumn;
+    }
+
+    public void setPosition(Position position) {
+        this.position = position;
+    }
+
+    public Position getPosition() {
+        return position;
+    }
+
+    public void setW(BigDecimal w) {
+        this.w = w;
+    }
+
+    public BigDecimal getW() {
+        return w;
+    }
+}
+// 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/WstQRange.java	Thu Mar 10 13:44:51 2011 +0000
@@ -0,0 +1,41 @@
+package de.intevation.flys.model;
+
+import java.math.BigDecimal;
+
+import java.io.Serializable;
+
+public class WstQRange
+implements   Serializable
+{
+    private Long       id;
+    private Range      range;
+    private BigDecimal q;
+
+    public WstQRange() {
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRange(Range range) {
+        this.range = range;
+    }
+
+    public Range getRange() {
+        return range;
+    }
+
+    public void setQ(BigDecimal q) {
+        this.q = q;
+    }
+
+    public BigDecimal getQ() {
+        return q;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org