Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/SedimentLoadLS.java @ 8026:4b3054edbbaf
Added Hibernate mappings for new sediment load database model.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 10 Jul 2014 12:04:56 +0200 |
parents | c915e99d9e52 |
children | fd3a24336e6a |
comparison
equal
deleted
inserted
replaced
8025:c915e99d9e52 | 8026:4b3054edbbaf |
---|---|
12 import java.util.ArrayList; | 12 import java.util.ArrayList; |
13 import java.util.List; | 13 import java.util.List; |
14 | 14 |
15 import javax.persistence.Entity; | 15 import javax.persistence.Entity; |
16 import javax.persistence.Id; | 16 import javax.persistence.Id; |
17 import javax.persistence.OneToMany; | |
17 import javax.persistence.Table; | 18 import javax.persistence.Table; |
18 import javax.persistence.GeneratedValue; | 19 import javax.persistence.GeneratedValue; |
19 import javax.persistence.Column; | 20 import javax.persistence.Column; |
20 import javax.persistence.SequenceGenerator; | 21 import javax.persistence.SequenceGenerator; |
21 import javax.persistence.GenerationType; | 22 import javax.persistence.GenerationType; |
22 import javax.persistence.JoinColumn; | 23 import javax.persistence.JoinColumn; |
23 import javax.persistence.OneToOne; | 24 import javax.persistence.OneToOne; |
24 | 25 |
25 import org.apache.log4j.Logger; | |
26 | |
27 | 26 |
28 /** SedimentYield of a certain Fraction with possibly many values. */ | 27 /** SedimentYield of a certain Fraction with possibly many values. */ |
29 @Entity | 28 @Entity |
30 @Table(name = "sediment_yield") | 29 @Table(name = "sediment_yield") |
31 public class SedimentLoadLS | 30 public class SedimentLoadLS |
32 implements Serializable | 31 implements Serializable |
33 { | 32 { |
34 private static Logger logger = Logger.getLogger(SedimentLoadLS.class); | |
35 | |
36 private Integer id; | 33 private Integer id; |
37 | 34 |
38 private River river; | 35 private River river; |
39 | 36 |
40 private GrainFraction grainFraction; | 37 private GrainFraction grainFraction; |
49 | 46 |
50 private Integer kind; | 47 private Integer kind; |
51 | 48 |
52 | 49 |
53 public SedimentLoadLS() { | 50 public SedimentLoadLS() { |
54 this.values = new ArrayList<SedimentLoadLSValue>(); | |
55 } | 51 } |
56 | 52 |
57 public SedimentLoadLS(River river, Unit unit, TimeInterval timeInterval) { | 53 public SedimentLoadLS(River river, Unit unit, TimeInterval timeInterval) { |
58 this(); | 54 this(); |
59 | 55 |
160 } | 156 } |
161 | 157 |
162 public void setKind(Integer newKind) { | 158 public void setKind(Integer newKind) { |
163 this.kind = newKind; | 159 this.kind = newKind; |
164 } | 160 } |
161 | |
162 @OneToMany | |
163 @JoinColumn(name="sediment_yield_id") | |
164 public List<SedimentLoadLSValue> getSedimentLoadLSValues() { | |
165 return values; | |
166 } | |
167 | |
168 public void setSedimentLoadLSValues(List<SedimentLoadLSValue> values) { | |
169 this.values = values; | |
170 } | |
165 } | 171 } |
166 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 172 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |