Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Wed Mar 23 16:33:36 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Thu Mar 24 16:47:05 2011 +0000 @@ -4,6 +4,8 @@ import java.io.Serializable; +import java.util.List; + import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @@ -13,6 +15,7 @@ import javax.persistence.GenerationType; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.OneToMany; @Entity @Table(name = "gauges") @@ -27,6 +30,8 @@ private BigDecimal datum; private Range range; + private List<DischargeTable> dischargeTables; + public Gauge() { } @@ -118,5 +123,15 @@ public void setRange(Range range) { this.range = range; } + + @OneToMany + @JoinColumn(name = "gauge_id") + public List<DischargeTable> getDischargeTables() { + return dischargeTables; + } + + public void setDischargeTables(List<DischargeTable> dischargeTables) { + this.dischargeTables = dischargeTables; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :