Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/HYKFormation.java @ 1210:31d8638760b1
New. The hibernate models
for the HYK structures.
flys-backend/trunk@2336 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 15 Jul 2011 11:12:14 +0000 |
parents | |
children | 32ee9babe42c |
comparison
equal
deleted
inserted
replaced
1209:c12b5fbd33e8 | 1210:31d8638760b1 |
---|---|
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 | |
32 private List<HYKFlowZone> zones; | |
33 | |
34 public HYKFormation() { | |
35 } | |
36 | |
37 public HYKFormation( | |
38 Integer formationNum, | |
39 HYKEntry entry, | |
40 BigDecimal top, | |
41 BigDecimal bottom | |
42 ) { | |
43 this.formationNum = formationNum; | |
44 this.entry = entry; | |
45 this.top = top; | |
46 this.bottom = bottom; | |
47 } | |
48 | |
49 @Id | |
50 @SequenceGenerator( | |
51 name = "SEQUENCE_HYK_FORMATIONS_ID_SEQ", | |
52 sequenceName = "HYK_FORMATIONS_ID_SEQ", | |
53 allocationSize = 1) | |
54 @GeneratedValue( | |
55 strategy = GenerationType.SEQUENCE, | |
56 generator = "SEQUENCE_HYK_FORMATIONS_ID_SEQ") | |
57 @Column(name = "id") | |
58 public Integer getId() { | |
59 return id; | |
60 } | |
61 | |
62 public void setId(Integer id) { | |
63 this.id = id; | |
64 } | |
65 | |
66 @Column(name = "formation_num") | |
67 public Integer getFormationNum() { | |
68 return formationNum; | |
69 } | |
70 | |
71 public void setFormationNum(Integer formationNum) { | |
72 this.formationNum = formationNum; | |
73 } | |
74 | |
75 @OneToOne | |
76 @JoinColumn(name = "hyk_entry_id") | |
77 public HYKEntry getEntry() { | |
78 return entry; | |
79 } | |
80 | |
81 public void setEntry(HYKEntry entry) { | |
82 this.entry = entry; | |
83 } | |
84 | |
85 @Column(name = "top") | |
86 public BigDecimal getTop() { | |
87 return top; | |
88 } | |
89 | |
90 public void setTop(BigDecimal top) { | |
91 this.top = top; | |
92 } | |
93 | |
94 @Column(name = "bottom") | |
95 public BigDecimal getBottom() { | |
96 return bottom; | |
97 } | |
98 | |
99 public void setBottom(BigDecimal bottom) { | |
100 this.bottom = bottom; | |
101 } | |
102 | |
103 @OneToMany | |
104 @OrderBy("a") | |
105 @JoinColumn(name="formation_id") | |
106 public List<HYKFlowZone> getZones() { | |
107 return zones; | |
108 } | |
109 | |
110 public void setZones(List<HYKFlowZone> zones) { | |
111 this.zones = zones; | |
112 } | |
113 } | |
114 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |