comparison flys-backend/src/main/java/org/dive4elements/river/model/SedimentDensity.java @ 5828:dfb26b03b179

Moved directories to org.dive4elements.river
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 11:53:11 +0200
parents flys-backend/src/main/java/de/intevation/flys/model/SedimentDensity.java@7c1dd9c3f6bd
children 18619c1e7c2a
comparison
equal deleted inserted replaced
5827:e308d4ecd35a 5828:dfb26b03b179
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 List<SedimentDensityValue> values;
29
30 private String description;
31
32
33 public SedimentDensity() {
34 }
35
36
37 public SedimentDensity(River river, Depth depth, String desc) {
38 this.river = river;
39 this.depth = depth;
40 this.description = desc;
41 }
42
43 @Id
44 @SequenceGenerator(
45 name = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ",
46 sequenceName = "SEDIMENT_DENSITY_ID_SEQ",
47 allocationSize = 1)
48 @GeneratedValue(
49 strategy = GenerationType.SEQUENCE,
50 generator = "SEQUENCE_SEDIMENT_DENSITY_ID_SEQ")
51 @Column(name = "id")
52 public Integer getId() {
53 return id;
54 }
55
56 public void setId(Integer id) {
57 this.id = id;
58 }
59
60 @OneToOne
61 @JoinColumn(name = "river_id" )
62 public River getRiver() {
63 return river;
64 }
65
66 public void setRiver(River river) {
67 this.river = river;
68 }
69
70 @OneToOne
71 @JoinColumn(name = "depth_id")
72 public Depth getDepth() {
73 return depth;
74 }
75
76 public void setDepth(Depth depth) {
77 this.depth = depth;
78 }
79
80 @Column(name = "description")
81 public String getDescription() {
82 return description;
83 }
84
85 public void setDescription(String description) {
86 this.description = description;
87 }
88
89 @OneToMany
90 @JoinColumn(name="sediment_density_id")
91 public List<SedimentDensityValue> getValues() {
92 return values;
93 }
94
95 public void setValues(List<SedimentDensityValue> values) {
96 this.values = values;
97 }
98
99 public void addValue(SedimentDensityValue value) {
100 this.values.add(value);
101 }
102 }
103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org