Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/GrainFraction.java @ 2839:163c037f2c7e
Added config option to skip parsing sediment yield data and prepared the importer to read/store those data.
flys-backend/trunk@4272 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 19 Apr 2012 07:34:50 +0000 |
parents | 8b910e3277b0 |
children | 71175502d868 |
rev | line source |
---|---|
2837
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.model; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import javax.persistence.Entity; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import javax.persistence.Id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import javax.persistence.Table; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import javax.persistence.GeneratedValue; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import javax.persistence.Column; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import javax.persistence.SequenceGenerator; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import javax.persistence.GenerationType; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import javax.persistence.JoinColumn; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import javax.persistence.OneToOne; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.apache.log4j.Logger; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 @Entity |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 @Table(name = "grain_fraction") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 public class GrainFraction |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 implements Serializable |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 private static Logger logger = Logger.getLogger(GrainFraction.class); |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 private Integer id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 private String name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 private Double lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private Double upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 private Unit unit; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public GrainFraction() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public GrainFraction(String name, Double lower, Double upper, Unit unit) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 this.name = name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 this.lower = lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 this.upper = upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 this.unit = unit; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 @Id |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 @SequenceGenerator( |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 name = "SEQUENCE_GRAIN_FRACTION_ID_SEQ", |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 sequenceName = "GRAIN_FRACTION_ID_SEQ", |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 allocationSize = 1) |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 @GeneratedValue( |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 strategy = GenerationType.SEQUENCE, |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 generator = "SEQUENCE_GRAIN_FRACTION_ID_SEQ") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 @Column(name = "id") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public Integer getId() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 return id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 public void setId(Integer id) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 this.id = id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 @Column(name = "name" ) |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 public String getName() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 return name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 public void setName(String name) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 this.name = name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 @Column(name = "lower") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 public Double getLower() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 return lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 public void setLower(Double lower) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 this.lower = lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 @Column(name = "upper") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 public Double getUpper() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 return upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 public void setUpper(Double upper) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 this.upper = upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 @OneToOne |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 @JoinColumn(name = "unit_id") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public Unit getUnit() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 return unit; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 public void setUnit(Unit unit) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 this.unit = unit; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |