Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/SedimentDensity.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 | 8979f2294af9 |
children | 7c1dd9c3f6bd |
comparison
equal
deleted
inserted
replaced
2793:6310b1582f2d | 2877:f0a67bc0e777 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 import java.util.List; | |
5 | |
6 import javax.persistence.Entity; | |
7 import javax.persistence.Id; | |
8 import javax.persistence.Table; | |
9 import javax.persistence.GeneratedValue; | |
10 import javax.persistence.Column; | |
11 import javax.persistence.SequenceGenerator; | |
12 import javax.persistence.GenerationType; | |
13 import javax.persistence.JoinColumn; | |
14 import javax.persistence.OneToOne; | |
15 import javax.persistence.OneToMany; | |
16 | |
17 | |
18 @Entity | |
19 @Table(name = "sediment_density") | |
20 public class SedimentDensity implements Serializable { | |
21 | |
22 private Integer id; | |
23 | |
24 private River river; | |
25 | |
26 private Depth depth; | |
27 | |
28 private Unit unit; | |
29 | |
30 private List<SedimentDensityValue> values; | |
31 | |
32 private String description; | |
33 | |
34 | |
35 public SedimentDensity() { | |
36 } | |
37 | |
38 | |
39 public SedimentDensity(River river, Depth depth, Unit unit, String desc) { | |
40 this.river = river; | |
41 this.depth = depth; | |
42 this.unit = unit; | |
43 this.description = desc; | |
44 } | |
45 | |
46 @Id | |
47 @SequenceGenerator( | |
48 name = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ", | |
49 sequenceName = "SEDIMENT_DENSITY_ID_SEQ", | |
50 allocationSize = 1) | |
51 @GeneratedValue( | |
52 strategy = GenerationType.SEQUENCE, | |
53 generator = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ") | |
54 @Column(name = "id") | |
55 public Integer getId() { | |
56 return id; | |
57 } | |
58 | |
59 public void setId(Integer id) { | |
60 this.id = id; | |
61 } | |
62 | |
63 @OneToOne | |
64 @JoinColumn(name = "river_id" ) | |
65 public River getRiver() { | |
66 return river; | |
67 } | |
68 | |
69 public void setRiver(River river) { | |
70 this.river = river; | |
71 } | |
72 | |
73 @OneToOne | |
74 @JoinColumn(name = "depth_id") | |
75 public Depth getDepth() { | |
76 return depth; | |
77 } | |
78 | |
79 public void setDepth(Depth depth) { | |
80 this.depth = depth; | |
81 } | |
82 | |
83 @OneToOne | |
84 @JoinColumn(name = "unit_id") | |
85 public Unit getUnit() { | |
86 return unit; | |
87 } | |
88 | |
89 public void setUnit(Unit unit) { | |
90 this.unit = unit; | |
91 } | |
92 | |
93 @Column(name = "description") | |
94 public String getDescription() { | |
95 return description; | |
96 } | |
97 | |
98 public void setDescription(String description) { | |
99 this.description = description; | |
100 } | |
101 | |
102 @OneToMany | |
103 @JoinColumn(name="sediment_density_id") | |
104 public List<SedimentDensityValue> getValues() { | |
105 return values; | |
106 } | |
107 | |
108 public void setValues(List<SedimentDensityValue> values) { | |
109 this.values = values; | |
110 } | |
111 | |
112 public void addValue(SedimentDensityValue value) { | |
113 this.values.add(value); | |
114 } | |
115 } | |
116 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |