comparison flys-backend/src/main/java/de/intevation/flys/model/WaterlevelQRange.java @ 2877:f0a67bc0e777 2.7

merged flys-backend/2.7
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:31 +0200
parents 0d55b7722fae
children
comparison
equal deleted inserted replaced
2793:6310b1582f2d 2877:f0a67bc0e777
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.persistence.Entity;
8 import javax.persistence.Id;
9 import javax.persistence.Table;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.Column;
12 import javax.persistence.SequenceGenerator;
13 import javax.persistence.GenerationType;
14 import javax.persistence.JoinColumn;
15 import javax.persistence.OneToOne;
16 import javax.persistence.OneToMany;
17
18 import org.apache.log4j.Logger;
19
20
21
22
23 @Entity
24 @Table(name = "waterlevel_q_range")
25 public class WaterlevelQRange
26 implements Serializable
27 {
28 private static Logger logger = Logger.getLogger(WaterlevelQRange.class);
29
30 private Integer id;
31
32 private Waterlevel waterlevel;
33
34 private Double q;
35
36 private List<WaterlevelValue> values;
37
38
39 public WaterlevelQRange() {
40 this.values = new ArrayList<WaterlevelValue>();
41 }
42
43 public WaterlevelQRange(Waterlevel waterlevel, Double q) {
44 this();
45 this.q = q;
46 this.waterlevel = waterlevel;
47 }
48
49
50 @Id
51 @SequenceGenerator(
52 name = "SEQUENCE_WATERLEVEL_Q_RANGE_ID_SEQ",
53 sequenceName = "WATERLEVEL_Q_RANGES_ID_SEQ",
54 allocationSize = 1)
55 @GeneratedValue(
56 strategy = GenerationType.SEQUENCE,
57 generator = "SEQUENCE_WATERLEVEL_Q_RANGE_ID_SEQ")
58 @Column(name = "id")
59 public Integer getId() {
60 return id;
61 }
62
63 public void setId(Integer id) {
64 this.id = id;
65 }
66
67 @OneToOne
68 @JoinColumn(name = "waterlevel_id" )
69 public Waterlevel getWaterlevel() {
70 return waterlevel;
71 }
72
73 public void setWaterlevel(Waterlevel waterlevel) {
74 this.waterlevel = waterlevel;
75 }
76
77 @Column(name = "q")
78 public Double getQ() {
79 return q;
80 }
81
82 public void setQ(Double q) {
83 this.q = q;
84 }
85
86 @OneToMany
87 @Column(name = "waterlevel_q_range_id")
88 public List<WaterlevelValue> getValues() {
89 return values;
90 }
91
92 public void setValues(List<WaterlevelValue> values) {
93 this.values = values;
94 }
95
96 public void addValue(WaterlevelValue value) {
97 values.add(value);
98 }
99 }
100 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org