Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModel.java @ 2825:a948366d8ac5
Added new model classes for MINFO specific flow velocity.
flys-backend/trunk@4242 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 17 Apr 2012 06:36:39 +0000 |
parents | |
children | 5a89c2b05e6d |
comparison
equal
deleted
inserted
replaced
2824:85b2b5e7377f | 2825:a948366d8ac5 |
---|---|
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 | |
16 import org.apache.log4j.Logger; | |
17 | |
18 | |
19 @Entity | |
20 @Table(name = "flow_velocity_model") | |
21 public class FlowVelocityModel | |
22 implements Serializable | |
23 { | |
24 private static Logger logger = Logger.getLogger(FlowVelocityModel.class); | |
25 | |
26 | |
27 private Integer id; | |
28 | |
29 private River river; | |
30 | |
31 private DischargeZone dischargeZone; | |
32 | |
33 private List<FlowVelocityModelValue> values; | |
34 | |
35 private String description; | |
36 | |
37 | |
38 public FlowVelocityModel() { | |
39 } | |
40 | |
41 | |
42 public FlowVelocityModel(River river, DischargeZone dischargeZone) { | |
43 this(river, dischargeZone, null); | |
44 } | |
45 | |
46 | |
47 public FlowVelocityModel( | |
48 River river, | |
49 DischargeZone dischargeZone, | |
50 String description | |
51 ) { | |
52 this.river = river; | |
53 this.dischargeZone = dischargeZone; | |
54 this.description = description; | |
55 } | |
56 | |
57 @Id | |
58 @SequenceGenerator( | |
59 name = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ", | |
60 sequenceName = "FLOW_VELOCITY_MODEL_ID_SEQ", | |
61 allocationSize = 1) | |
62 @GeneratedValue( | |
63 strategy = GenerationType.SEQUENCE, | |
64 generator = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ") | |
65 @Column(name = "id") | |
66 public Integer getId() { | |
67 return id; | |
68 } | |
69 | |
70 public void setId(Integer id) { | |
71 this.id = id; | |
72 } | |
73 | |
74 @OneToOne | |
75 @JoinColumn(name = "river_id") | |
76 public River getRiver() { | |
77 return river; | |
78 } | |
79 | |
80 public void setRiver(River river) { | |
81 this.river = river; | |
82 } | |
83 | |
84 @OneToOne | |
85 @JoinColumn(name = "discharge_zone_id") | |
86 public DischargeZone getDischargeZone() { | |
87 return dischargeZone; | |
88 } | |
89 | |
90 public void setDischargeZone(DischargeZone dischargeZone) { | |
91 this.dischargeZone = dischargeZone; | |
92 } | |
93 | |
94 @Column(name = "description") | |
95 public String getDescription() { | |
96 return description; | |
97 } | |
98 | |
99 public void setDescription(String description) { | |
100 this.description = description; | |
101 } | |
102 } | |
103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |