Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/GrainFraction.java @ 2877:f0a67bc0e777 2.7
merged flys-backend/2.7
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:31 +0200 |
parents | 71175502d868 |
children | 7aeb2c101628 |
comparison
equal
deleted
inserted
replaced
2793:6310b1582f2d | 2877:f0a67bc0e777 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import javax.persistence.Entity; | |
6 import javax.persistence.Id; | |
7 import javax.persistence.Table; | |
8 import javax.persistence.GeneratedValue; | |
9 import javax.persistence.Column; | |
10 import javax.persistence.SequenceGenerator; | |
11 import javax.persistence.GenerationType; | |
12 import javax.persistence.JoinColumn; | |
13 import javax.persistence.OneToOne; | |
14 | |
15 import org.apache.log4j.Logger; | |
16 | |
17 | |
18 @Entity | |
19 @Table(name = "grain_fraction") | |
20 public class GrainFraction | |
21 implements Serializable | |
22 { | |
23 public static final String TOTAL = "total"; | |
24 public static final String COARSE = "coarse"; | |
25 public static final String FINE_MIDDLE = "fine_middle"; | |
26 public static final String SAND = "sand"; | |
27 public static final String SUSP_SAND = "susp_sand"; | |
28 public static final String SUSP_SAND_BED = "susp_sand_bed"; | |
29 public static final String SUSPENDED_SEDIMENT = "suspended_sediment"; | |
30 | |
31 | |
32 private static Logger logger = Logger.getLogger(GrainFraction.class); | |
33 | |
34 private Integer id; | |
35 | |
36 private String name; | |
37 | |
38 private Double lower; | |
39 private Double upper; | |
40 | |
41 private Unit unit; | |
42 | |
43 | |
44 public GrainFraction() { | |
45 } | |
46 | |
47 public GrainFraction(String name, Double lower, Double upper, Unit unit) { | |
48 this.name = name; | |
49 this.lower = lower; | |
50 this.upper = upper; | |
51 this.unit = unit; | |
52 } | |
53 | |
54 @Id | |
55 @SequenceGenerator( | |
56 name = "SEQUENCE_GRAIN_FRACTION_ID_SEQ", | |
57 sequenceName = "GRAIN_FRACTION_ID_SEQ", | |
58 allocationSize = 1) | |
59 @GeneratedValue( | |
60 strategy = GenerationType.SEQUENCE, | |
61 generator = "SEQUENCE_GRAIN_FRACTION_ID_SEQ") | |
62 @Column(name = "id") | |
63 public Integer getId() { | |
64 return id; | |
65 } | |
66 | |
67 public void setId(Integer id) { | |
68 this.id = id; | |
69 } | |
70 | |
71 @Column(name = "name" ) | |
72 public String getName() { | |
73 return name; | |
74 } | |
75 | |
76 public void setName(String name) { | |
77 this.name = name; | |
78 } | |
79 | |
80 @Column(name = "lower") | |
81 public Double getLower() { | |
82 return lower; | |
83 } | |
84 | |
85 public void setLower(Double lower) { | |
86 this.lower = lower; | |
87 } | |
88 | |
89 @Column(name = "upper") | |
90 public Double getUpper() { | |
91 return upper; | |
92 } | |
93 | |
94 public void setUpper(Double upper) { | |
95 this.upper = upper; | |
96 } | |
97 | |
98 @OneToOne | |
99 @JoinColumn(name = "unit_id") | |
100 public Unit getUnit() { | |
101 return unit; | |
102 } | |
103 | |
104 public void setUnit(Unit unit) { | |
105 this.unit = unit; | |
106 } | |
107 } | |
108 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |