Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/SedimentDensity.java @ 5800:397ff862b417
WOutProcessor: Renaming, doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 08:24:56 +0200 |
parents | 7c1dd9c3f6bd |
children |
rev | line source |
---|---|
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.model; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import javax.persistence.Entity; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import javax.persistence.Id; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import javax.persistence.Table; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import javax.persistence.GeneratedValue; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import javax.persistence.Column; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import javax.persistence.SequenceGenerator; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import javax.persistence.GenerationType; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import javax.persistence.JoinColumn; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import javax.persistence.OneToOne; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import javax.persistence.OneToMany; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 @Entity |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 @Table(name = "sediment_density") |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 public class SedimentDensity implements Serializable { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 private Integer id; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 private River river; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 private Depth depth; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 private List<SedimentDensityValue> values; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
30 private String description; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
31 |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 public SedimentDensity() { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
5441
7c1dd9c3f6bd
remove unit from sediment density and depths (always t/m3 respectively cm, otherwise a typo)
Tom Gottfried <tom.gottfried@intevation.de>
parents:
2817
diff
changeset
|
37 public SedimentDensity(River river, Depth depth, String desc) { |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
38 this.river = river; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
39 this.depth = depth; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
40 this.description = desc; |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 @Id |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 @SequenceGenerator( |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 name = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ", |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 sequenceName = "SEDIMENT_DENSITY_ID_SEQ", |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 allocationSize = 1) |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 @GeneratedValue( |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 strategy = GenerationType.SEQUENCE, |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 generator = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ") |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 @Column(name = "id") |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 public Integer getId() { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 return id; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 public void setId(Integer id) { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 this.id = id; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 @OneToOne |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 @JoinColumn(name = "river_id" ) |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 public River getRiver() { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 return river; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 public void setRiver(River river) { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 this.river = river; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 @OneToOne |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 @JoinColumn(name = "depth_id") |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 public Depth getDepth() { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 return depth; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 public void setDepth(Depth depth) { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 this.depth = depth; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
80 @Column(name = "description") |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
81 public String getDescription() { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
82 return description; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
83 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
84 |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
85 public void setDescription(String description) { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
86 this.description = description; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
87 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
88 |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 @OneToMany |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 @JoinColumn(name="sediment_density_id") |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public List<SedimentDensityValue> getValues() { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 return values; |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
2817
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
95 public void setValues(List<SedimentDensityValue> values) { |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
96 this.values = values; |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
97 } |
8979f2294af9
Finished parsing MINFO specific sediment density.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2812
diff
changeset
|
98 |
2812
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 public void addValue(SedimentDensityValue value) { |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 this.values.add(value); |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 } |
a36a5407acbf
Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |