Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/GrainFraction.java @ 2837:8b910e3277b0
Added new model classes for sediment yield data.
flys-backend/trunk@4269 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Apr 2012 12:54:51 +0000 |
parents | |
children | 71175502d868 |
comparison
equal
deleted
inserted
replaced
2836:6b541d85c5cf | 2837:8b910e3277b0 |
---|---|
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 private static Logger logger = Logger.getLogger(GrainFraction.class); | |
24 | |
25 private Integer id; | |
26 | |
27 private String name; | |
28 | |
29 private Double lower; | |
30 private Double upper; | |
31 | |
32 private Unit unit; | |
33 | |
34 | |
35 public GrainFraction() { | |
36 } | |
37 | |
38 public GrainFraction(String name, Double lower, Double upper, Unit unit) { | |
39 this.name = name; | |
40 this.lower = lower; | |
41 this.upper = upper; | |
42 this.unit = unit; | |
43 } | |
44 | |
45 @Id | |
46 @SequenceGenerator( | |
47 name = "SEQUENCE_GRAIN_FRACTION_ID_SEQ", | |
48 sequenceName = "GRAIN_FRACTION_ID_SEQ", | |
49 allocationSize = 1) | |
50 @GeneratedValue( | |
51 strategy = GenerationType.SEQUENCE, | |
52 generator = "SEQUENCE_GRAIN_FRACTION_ID_SEQ") | |
53 @Column(name = "id") | |
54 public Integer getId() { | |
55 return id; | |
56 } | |
57 | |
58 public void setId(Integer id) { | |
59 this.id = id; | |
60 } | |
61 | |
62 @Column(name = "name" ) | |
63 public String getName() { | |
64 return name; | |
65 } | |
66 | |
67 public void setName(String name) { | |
68 this.name = name; | |
69 } | |
70 | |
71 @Column(name = "lower") | |
72 public Double getLower() { | |
73 return lower; | |
74 } | |
75 | |
76 public void setLower(Double lower) { | |
77 this.lower = lower; | |
78 } | |
79 | |
80 @Column(name = "upper") | |
81 public Double getUpper() { | |
82 return upper; | |
83 } | |
84 | |
85 public void setUpper(Double upper) { | |
86 this.upper = upper; | |
87 } | |
88 | |
89 @OneToOne | |
90 @JoinColumn(name = "unit_id") | |
91 public Unit getUnit() { | |
92 return unit; | |
93 } | |
94 | |
95 public void setUnit(Unit unit) { | |
96 this.unit = unit; | |
97 } | |
98 } | |
99 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |