Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/SedimentLoadLS.java @ 8025:c915e99d9e52
Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 09 Jul 2014 18:13:13 +0200 |
parents | |
children | 4b3054edbbaf |
comparison
equal
deleted
inserted
replaced
8024:963ede7b32bb | 8025:c915e99d9e52 |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.model; | |
10 | |
11 import java.io.Serializable; | |
12 import java.util.ArrayList; | |
13 import java.util.List; | |
14 | |
15 import javax.persistence.Entity; | |
16 import javax.persistence.Id; | |
17 import javax.persistence.Table; | |
18 import javax.persistence.GeneratedValue; | |
19 import javax.persistence.Column; | |
20 import javax.persistence.SequenceGenerator; | |
21 import javax.persistence.GenerationType; | |
22 import javax.persistence.JoinColumn; | |
23 import javax.persistence.OneToOne; | |
24 | |
25 import org.apache.log4j.Logger; | |
26 | |
27 | |
28 /** SedimentYield of a certain Fraction with possibly many values. */ | |
29 @Entity | |
30 @Table(name = "sediment_yield") | |
31 public class SedimentLoadLS | |
32 implements Serializable | |
33 { | |
34 private static Logger logger = Logger.getLogger(SedimentLoadLS.class); | |
35 | |
36 private Integer id; | |
37 | |
38 private River river; | |
39 | |
40 private GrainFraction grainFraction; | |
41 | |
42 private Unit unit; | |
43 | |
44 private TimeInterval timeInterval; | |
45 | |
46 private String description; | |
47 | |
48 private List<SedimentLoadLSValue> values; | |
49 | |
50 private Integer kind; | |
51 | |
52 | |
53 public SedimentLoadLS() { | |
54 this.values = new ArrayList<SedimentLoadLSValue>(); | |
55 } | |
56 | |
57 public SedimentLoadLS(River river, Unit unit, TimeInterval timeInterval) { | |
58 this(); | |
59 | |
60 this.river = river; | |
61 this.unit = unit; | |
62 this.timeInterval = timeInterval; | |
63 } | |
64 | |
65 | |
66 public SedimentLoadLS( | |
67 River river, | |
68 Unit unit, | |
69 TimeInterval timeInterval, | |
70 GrainFraction grainFraction | |
71 ) { | |
72 this(river, unit, timeInterval); | |
73 | |
74 this.grainFraction = grainFraction; | |
75 } | |
76 | |
77 | |
78 public SedimentLoadLS( | |
79 River river, | |
80 Unit unit, | |
81 TimeInterval timeInterval, | |
82 GrainFraction grainFraction, | |
83 String description | |
84 ) { | |
85 this(river, unit, timeInterval, grainFraction); | |
86 | |
87 this.description = description; | |
88 } | |
89 | |
90 @Id | |
91 @SequenceGenerator( | |
92 name = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ", | |
93 sequenceName = "SEDIMENT_YIELD_ID_SEQ", | |
94 allocationSize = 1) | |
95 @GeneratedValue( | |
96 strategy = GenerationType.SEQUENCE, | |
97 generator = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ") | |
98 @Column(name = "id") | |
99 public Integer getId() { | |
100 return id; | |
101 } | |
102 | |
103 public void setId(Integer id) { | |
104 this.id = id; | |
105 } | |
106 | |
107 @OneToOne | |
108 @JoinColumn(name = "river_id") | |
109 public River getRiver() { | |
110 return river; | |
111 } | |
112 | |
113 public void setRiver(River river) { | |
114 this.river = river; | |
115 } | |
116 | |
117 @OneToOne | |
118 @JoinColumn(name="grain_fraction_id") | |
119 public GrainFraction getGrainFraction() { | |
120 return grainFraction; | |
121 } | |
122 | |
123 public void setGrainFraction(GrainFraction grainFraction) { | |
124 this.grainFraction = grainFraction; | |
125 } | |
126 | |
127 @OneToOne | |
128 @JoinColumn(name = "unit_id") | |
129 public Unit getUnit() { | |
130 return unit; | |
131 } | |
132 | |
133 public void setUnit(Unit unit) { | |
134 this.unit = unit; | |
135 } | |
136 | |
137 @OneToOne | |
138 @JoinColumn(name = "time_interval_id") | |
139 public TimeInterval getTimeInterval() { | |
140 return timeInterval; | |
141 } | |
142 | |
143 public void setTimeInterval(TimeInterval timeInterval) { | |
144 this.timeInterval = timeInterval; | |
145 } | |
146 | |
147 @Column(name = "description") | |
148 public String getDescription() { | |
149 return description; | |
150 } | |
151 | |
152 public void setDescription(String description) { | |
153 this.description = description; | |
154 } | |
155 | |
156 /** kind == 0: "normal", kind == 1: "official epoch". */ | |
157 @Column(name = "kind") | |
158 public Integer getKind() { | |
159 return kind; | |
160 } | |
161 | |
162 public void setKind(Integer newKind) { | |
163 this.kind = newKind; | |
164 } | |
165 } | |
166 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |