Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/HYKEntry.java @ 3807:d73c43798a99 pre2.6-2011-11-04
merged flys-backend/pre2.6-2011-11-04
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:51 +0200 |
parents | 1f21f162bcf3 |
children |
comparison
equal
deleted
inserted
replaced
3806:881fcd01e056 | 3807:d73c43798a99 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import java.math.BigDecimal; | |
6 | |
7 import java.util.Date; | |
8 import java.util.List; | |
9 | |
10 import javax.persistence.Entity; | |
11 import javax.persistence.Id; | |
12 import javax.persistence.Table; | |
13 import javax.persistence.GeneratedValue; | |
14 import javax.persistence.Column; | |
15 import javax.persistence.SequenceGenerator; | |
16 import javax.persistence.GenerationType; | |
17 import javax.persistence.OneToOne; | |
18 import javax.persistence.OneToMany; | |
19 import javax.persistence.OrderBy; | |
20 import javax.persistence.JoinColumn; | |
21 | |
22 @Entity | |
23 @Table(name = "hyk_entries") | |
24 public class HYKEntry | |
25 implements Serializable | |
26 { | |
27 private Integer id; | |
28 private HYK hyk; | |
29 private BigDecimal km; | |
30 private Date measure; | |
31 | |
32 private List<HYKFormation> formations; | |
33 | |
34 public HYKEntry() { | |
35 } | |
36 | |
37 public HYKEntry(HYK hyk, BigDecimal km, Date measure) { | |
38 this.hyk = hyk; | |
39 this.km = km; | |
40 this.measure = measure; | |
41 } | |
42 | |
43 @Id | |
44 @SequenceGenerator( | |
45 name = "SEQUENCE_HYK_ENTRIES_ID_SEQ", | |
46 sequenceName = "HYK_ENTRIES_ID_SEQ", | |
47 allocationSize = 1) | |
48 @GeneratedValue( | |
49 strategy = GenerationType.SEQUENCE, | |
50 generator = "SEQUENCE_HYK_ENTRIES_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 = "hyk_id") | |
62 public HYK getHYK() { | |
63 return hyk; | |
64 } | |
65 | |
66 public void setHYK(HYK hyk) { | |
67 this.hyk = hyk; | |
68 } | |
69 | |
70 @Column(name = "km") | |
71 public BigDecimal getKm() { | |
72 return km; | |
73 } | |
74 | |
75 public void setKm(BigDecimal km) { | |
76 this.km = km; | |
77 } | |
78 | |
79 @Column(name = "measure") | |
80 public Date getMeasure() { | |
81 return measure; | |
82 } | |
83 | |
84 public void setMeasure(Date measure) { | |
85 this.measure = measure; | |
86 } | |
87 | |
88 @OneToMany | |
89 @OrderBy("formationNum") | |
90 @JoinColumn(name="hyk_entry_id") | |
91 public List<HYKFormation> getFormations() { | |
92 return formations; | |
93 } | |
94 | |
95 public void setFormations(List<HYKFormation> formations) { | |
96 this.formations = formations; | |
97 } | |
98 } | |
99 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |