Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 203:bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
flys-backend/trunk@1560 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 24 Mar 2011 16:47:05 +0000 |
parents | 31c48d54f09d |
children | 8d76556c9616 |
comparison
equal
deleted
inserted
replaced
202:29a408f80a89 | 203:bfee0e05b4e7 |
---|---|
1 package de.intevation.flys.model; | 1 package de.intevation.flys.model; |
2 | 2 |
3 import java.math.BigDecimal; | 3 import java.math.BigDecimal; |
4 | 4 |
5 import java.io.Serializable; | 5 import java.io.Serializable; |
6 | |
7 import java.util.List; | |
6 | 8 |
7 import javax.persistence.Entity; | 9 import javax.persistence.Entity; |
8 import javax.persistence.Id; | 10 import javax.persistence.Id; |
9 import javax.persistence.Table; | 11 import javax.persistence.Table; |
10 import javax.persistence.GeneratedValue; | 12 import javax.persistence.GeneratedValue; |
11 import javax.persistence.Column; | 13 import javax.persistence.Column; |
12 import javax.persistence.SequenceGenerator; | 14 import javax.persistence.SequenceGenerator; |
13 import javax.persistence.GenerationType; | 15 import javax.persistence.GenerationType; |
14 import javax.persistence.JoinColumn; | 16 import javax.persistence.JoinColumn; |
15 import javax.persistence.OneToOne; | 17 import javax.persistence.OneToOne; |
18 import javax.persistence.OneToMany; | |
16 | 19 |
17 @Entity | 20 @Entity |
18 @Table(name = "gauges") | 21 @Table(name = "gauges") |
19 public class Gauge | 22 public class Gauge |
20 implements Serializable | 23 implements Serializable |
24 private River river; | 27 private River river; |
25 private BigDecimal station; | 28 private BigDecimal station; |
26 private BigDecimal aeo; | 29 private BigDecimal aeo; |
27 private BigDecimal datum; | 30 private BigDecimal datum; |
28 private Range range; | 31 private Range range; |
32 | |
33 private List<DischargeTable> dischargeTables; | |
29 | 34 |
30 public Gauge() { | 35 public Gauge() { |
31 } | 36 } |
32 | 37 |
33 public Gauge( | 38 public Gauge( |
116 } | 121 } |
117 | 122 |
118 public void setRange(Range range) { | 123 public void setRange(Range range) { |
119 this.range = range; | 124 this.range = range; |
120 } | 125 } |
126 | |
127 @OneToMany | |
128 @JoinColumn(name = "gauge_id") | |
129 public List<DischargeTable> getDischargeTables() { | |
130 return dischargeTables; | |
131 } | |
132 | |
133 public void setDischargeTables(List<DischargeTable> dischargeTables) { | |
134 this.dischargeTables = dischargeTables; | |
135 } | |
121 } | 136 } |
122 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 137 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |