Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/HYKFormation.java @ 2386:cb7ebcadb214 2.6
merged flys-backend/2.6
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:23 +0200 |
parents | 32ee9babe42c |
children | 2ae732e2c65c |
comparison
equal
deleted
inserted
replaced
2333:66946e278e66 | 2386:cb7ebcadb214 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import java.util.List; | |
6 | |
7 import java.math.BigDecimal; | |
8 | |
9 import javax.persistence.Entity; | |
10 import javax.persistence.Id; | |
11 import javax.persistence.Table; | |
12 import javax.persistence.GeneratedValue; | |
13 import javax.persistence.Column; | |
14 import javax.persistence.SequenceGenerator; | |
15 import javax.persistence.GenerationType; | |
16 import javax.persistence.OneToOne; | |
17 import javax.persistence.OneToMany; | |
18 import javax.persistence.OrderBy; | |
19 import javax.persistence.JoinColumn; | |
20 | |
21 @Entity | |
22 @Table(name = "hyk_formations") | |
23 public class HYKFormation | |
24 implements Serializable | |
25 { | |
26 private Integer id; | |
27 private Integer formationNum; | |
28 private HYKEntry entry; | |
29 private BigDecimal top; | |
30 private BigDecimal bottom; | |
31 private BigDecimal distanceVL; | |
32 private BigDecimal distanceHF; | |
33 private BigDecimal distanceVR; | |
34 | |
35 private List<HYKFlowZone> zones; | |
36 | |
37 public HYKFormation() { | |
38 } | |
39 | |
40 public HYKFormation( | |
41 Integer formationNum, | |
42 HYKEntry entry, | |
43 BigDecimal top, | |
44 BigDecimal bottom, | |
45 BigDecimal distanceVL, | |
46 BigDecimal distanceHF, | |
47 BigDecimal distanceVR | |
48 ) { | |
49 this.formationNum = formationNum; | |
50 this.entry = entry; | |
51 this.top = top; | |
52 this.bottom = bottom; | |
53 this.distanceVL = distanceVL; | |
54 this.distanceHF = distanceHF; | |
55 this.distanceVR = distanceVR; | |
56 } | |
57 | |
58 @Id | |
59 @SequenceGenerator( | |
60 name = "SEQUENCE_HYK_FORMATIONS_ID_SEQ", | |
61 sequenceName = "HYK_FORMATIONS_ID_SEQ", | |
62 allocationSize = 1) | |
63 @GeneratedValue( | |
64 strategy = GenerationType.SEQUENCE, | |
65 generator = "SEQUENCE_HYK_FORMATIONS_ID_SEQ") | |
66 @Column(name = "id") | |
67 public Integer getId() { | |
68 return id; | |
69 } | |
70 | |
71 public void setId(Integer id) { | |
72 this.id = id; | |
73 } | |
74 | |
75 @Column(name = "formation_num") | |
76 public Integer getFormationNum() { | |
77 return formationNum; | |
78 } | |
79 | |
80 public void setFormationNum(Integer formationNum) { | |
81 this.formationNum = formationNum; | |
82 } | |
83 | |
84 @OneToOne | |
85 @JoinColumn(name = "hyk_entry_id") | |
86 public HYKEntry getEntry() { | |
87 return entry; | |
88 } | |
89 | |
90 public void setEntry(HYKEntry entry) { | |
91 this.entry = entry; | |
92 } | |
93 | |
94 @Column(name = "top") | |
95 public BigDecimal getTop() { | |
96 return top; | |
97 } | |
98 | |
99 public void setTop(BigDecimal top) { | |
100 this.top = top; | |
101 } | |
102 | |
103 @Column(name = "bottom") | |
104 public BigDecimal getBottom() { | |
105 return bottom; | |
106 } | |
107 | |
108 public void setBottom(BigDecimal bottom) { | |
109 this.bottom = bottom; | |
110 } | |
111 | |
112 @Column(name = "distance_vl") | |
113 public BigDecimal getDistanceVL() { | |
114 return distanceVL; | |
115 } | |
116 | |
117 public void setDistanceVL(BigDecimal distanceVL) { | |
118 this.distanceVL = distanceVL; | |
119 } | |
120 | |
121 @Column(name = "distance_hf") | |
122 public BigDecimal getDistanceHF() { | |
123 return distanceHF; | |
124 } | |
125 | |
126 public void setDistanceHF(BigDecimal distanceHF) { | |
127 this.distanceHF = distanceHF; | |
128 } | |
129 | |
130 @Column(name = "distance_vr") | |
131 public BigDecimal getDistanceVR() { | |
132 return distanceVR; | |
133 } | |
134 | |
135 public void setDistanceVR(BigDecimal distanceVR) { | |
136 this.distanceVR = distanceVR; | |
137 } | |
138 | |
139 | |
140 @OneToMany | |
141 @OrderBy("a") | |
142 @JoinColumn(name="formation_id") | |
143 public List<HYKFlowZone> getZones() { | |
144 return zones; | |
145 } | |
146 | |
147 public void setZones(List<HYKFlowZone> zones) { | |
148 this.zones = zones; | |
149 } | |
150 } | |
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |