Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurement.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurement.java@18619c1e7c2a |
children | 4dd33b86dc61 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.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 import org.apache.log4j.Logger; | |
18 | |
19 | |
20 @Entity | |
21 @Table(name = "flow_velocity_measurements") | |
22 public class FlowVelocityMeasurement | |
23 implements Serializable | |
24 { | |
25 private static Logger logger = | |
26 Logger.getLogger(FlowVelocityMeasurement.class); | |
27 | |
28 private Integer id; | |
29 | |
30 private River river; | |
31 | |
32 private String description; | |
33 | |
34 private List<FlowVelocityMeasurementValue> values; | |
35 | |
36 | |
37 public FlowVelocityMeasurement() { | |
38 } | |
39 | |
40 | |
41 public FlowVelocityMeasurement(River river, String description) { | |
42 this.river = river; | |
43 this.description = description; | |
44 } | |
45 | |
46 @Id | |
47 @SequenceGenerator( | |
48 name = "SEQUENCE_FV_MEASURE_ID_SEQ", | |
49 sequenceName = "FV_MEASURE_ID_SEQ", | |
50 allocationSize = 1) | |
51 @GeneratedValue( | |
52 strategy = GenerationType.SEQUENCE, | |
53 generator = "SEQUENCE_FV_MEASURE_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 @Column(name = "description") | |
74 public String getDescription() { | |
75 return description; | |
76 } | |
77 | |
78 public void setDescription(String description) { | |
79 this.description = description; | |
80 } | |
81 | |
82 @OneToMany | |
83 @JoinColumn(name = "measurements_id") | |
84 public List<FlowVelocityMeasurementValue> getValues() { | |
85 return values; | |
86 } | |
87 | |
88 public void setValues(List<FlowVelocityMeasurementValue> values) { | |
89 this.values = values; | |
90 } | |
91 | |
92 public void addValue(FlowVelocityMeasurementValue value) { | |
93 this.values.add(value); | |
94 } | |
95 } | |
96 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |