comparison flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java @ 508:a9c7f6ec3a5a 2.3.1

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

http://dive4elements.wald.intevation.org