Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/GrainFraction.java @ 5442:9575264f801d
Only create one FunctionResolver per BuildHelper. Creatin new ones over and over again is excessive.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Tue, 26 Mar 2013 21:55:23 +0100 |
parents | 7aeb2c101628 |
children | 3bd786772798 |
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 { |
2840
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
23 public static final String TOTAL = "total"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
24 public static final String COARSE = "coarse"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
25 public static final String FINE_MIDDLE = "fine_middle"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
26 public static final String SAND = "sand"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
27 public static final String SUSP_SAND = "susp_sand"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
28 public static final String SUSP_SAND_BED = "susp_sand_bed"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
29 public static final String SUSPENDED_SEDIMENT = "suspended_sediment"; |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
30 |
71175502d868
Added a parser for sediment yield files; started parsing and store values in db.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2837
diff
changeset
|
31 |
2837
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 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
|
33 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 private Integer id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 private String name; |
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 private Double lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 private Double upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 public GrainFraction() { |
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 |
5439
7aeb2c101628
removed unit from model and importer for grain fractions (its always mm, otherwise a typo)
Tom Gottfried <tom.gottfried@intevation.de>
parents:
2840
diff
changeset
|
45 public GrainFraction(String name, Double lower, Double upper) { |
2837
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 this.name = name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 this.lower = lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 this.upper = upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 @Id |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 @SequenceGenerator( |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 name = "SEQUENCE_GRAIN_FRACTION_ID_SEQ", |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 sequenceName = "GRAIN_FRACTION_ID_SEQ", |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 allocationSize = 1) |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 @GeneratedValue( |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 strategy = GenerationType.SEQUENCE, |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 generator = "SEQUENCE_GRAIN_FRACTION_ID_SEQ") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 @Column(name = "id") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 public Integer getId() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 return id; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 public void setId(Integer id) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 this.id = id; |
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 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 @Column(name = "name" ) |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 public String getName() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 return name; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 public void setName(String name) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 this.name = name; |
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 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 @Column(name = "lower") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 public Double getLower() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 return lower; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 public void setLower(Double lower) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 this.lower = lower; |
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 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 @Column(name = "upper") |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 public Double getUpper() { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 return upper; |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public void setUpper(Double upper) { |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 this.upper = upper; |
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 } |
8b910e3277b0
Added new model classes for sediment yield data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |