comparison flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java @ 3820:8a75cf0841b1 pre2.7-2012-03-16

merged flys-backend/pre2.7-2012-03-16
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:59 +0200
parents 67f362883fe4
children 7d4480c0e68e
comparison
equal deleted inserted replaced
3818:dc18457b1cef 3820:8a75cf0841b1
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4
5 import javax.persistence.Entity;
6 import javax.persistence.Id;
7 import javax.persistence.Table;
8 import javax.persistence.GeneratedValue;
9 import javax.persistence.Column;
10 import javax.persistence.SequenceGenerator;
11 import javax.persistence.GenerationType;
12 import javax.persistence.OneToMany;
13 import javax.persistence.OneToOne;
14 import javax.persistence.OrderBy;
15 import javax.persistence.JoinColumn;
16
17 import java.util.List;
18
19 @Entity
20 @Table(name = "discharge_tables")
21 public class DischargeTable
22 implements Serializable
23 {
24 private Integer id;
25 private Gauge gauge;
26 private String description;
27 private Integer kind;
28 private TimeInterval timeInterval;
29
30 private List<DischargeTableValue> dischargeTableValues;
31
32 public DischargeTable() {
33 kind = 0;
34 }
35
36 public DischargeTable(Gauge gauge) {
37 this(gauge, null, 0, null);
38 }
39
40 public DischargeTable(
41 Gauge gauge,
42 String description,
43 Integer kind,
44 TimeInterval timeInterval
45 ) {
46 this.gauge = gauge;
47 this.description = description;
48 this.kind = kind;
49 this.timeInterval = timeInterval;
50 }
51
52 @Id
53 @SequenceGenerator(
54 name = "SEQUENCE_DISCHARGE_TABLES_ID_SEQ",
55 sequenceName = "DISCHARGE_TABLES_ID_SEQ",
56 allocationSize = 1)
57 @GeneratedValue(
58 strategy = GenerationType.SEQUENCE,
59 generator = "SEQUENCE_DISCHARGE_TABLES_ID_SEQ")
60 @Column(name = "id")
61 public Integer getId() {
62 return id;
63 }
64
65 public void setId(Integer id) {
66 this.id = id;
67 }
68
69 @OneToOne
70 @JoinColumn(name = "gauge_id" )
71 public Gauge getGauge() {
72 return gauge;
73 }
74
75 public void setGauge(Gauge gauge) {
76 this.gauge = gauge;
77 }
78
79 @Column(name = "description")
80 public String getDescription() {
81 return description;
82 }
83
84 public void setDescription(String description) {
85 this.description = description;
86 }
87
88 @Column(name = "kind")
89 public Integer getKind() {
90 return kind;
91 }
92
93 public void setKind(Integer kind) {
94 this.kind = kind;
95 }
96
97 @OneToOne
98 @JoinColumn(name = "time_interval_id" )
99 public TimeInterval getTimeInterval() {
100 return timeInterval;
101 }
102
103 public void setTimeInterval(TimeInterval timeInterval) {
104 this.timeInterval = timeInterval;
105 }
106
107 @OneToMany
108 @JoinColumn(name = "table_id")
109 @OrderBy("q")
110 public List<DischargeTableValue> getDischargeTableValues() {
111 return dischargeTableValues;
112 }
113
114 public void setDischargeTableValues(
115 List<DischargeTableValue> dischargeTableValues
116 ) {
117 this.dischargeTableValues = dischargeTableValues;
118 }
119 }
120 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org