Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/MainValue.java @ 2877:f0a67bc0e777 2.7
merged flys-backend/2.7
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:31 +0200 |
parents | 8d3533a03e10 |
children | 407af2f1a364 |
comparison
equal
deleted
inserted
replaced
2793:6310b1582f2d | 2877:f0a67bc0e777 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import javax.persistence.Entity; | |
6 import javax.persistence.Id; | |
7 import javax.persistence.Table; | |
8 import javax.persistence.GeneratedValue; | |
9 import javax.persistence.Column; | |
10 import javax.persistence.SequenceGenerator; | |
11 import javax.persistence.OneToOne; | |
12 import javax.persistence.JoinColumn; | |
13 import javax.persistence.GenerationType; | |
14 | |
15 import java.math.BigDecimal; | |
16 | |
17 @Entity | |
18 @Table(name = "main_values") | |
19 public class MainValue | |
20 implements Serializable | |
21 { | |
22 private Integer id; | |
23 | |
24 private Gauge gauge; | |
25 | |
26 private NamedMainValue mainValue; | |
27 | |
28 private BigDecimal value; | |
29 | |
30 private TimeInterval timeInterval; | |
31 | |
32 public MainValue() { | |
33 } | |
34 | |
35 public MainValue( | |
36 Gauge gauge, | |
37 NamedMainValue mainValue, | |
38 BigDecimal value, | |
39 TimeInterval timeInterval | |
40 ) { | |
41 this.gauge = gauge; | |
42 this.mainValue = mainValue; | |
43 this.value = value; | |
44 this.timeInterval = timeInterval; | |
45 } | |
46 | |
47 @Id | |
48 @SequenceGenerator( | |
49 name = "SEQUENCE_MAIN_VALUES_ID_SEQ", | |
50 sequenceName = "MAIN_VALUES_ID_SEQ", | |
51 allocationSize = 1) | |
52 @GeneratedValue( | |
53 strategy = GenerationType.SEQUENCE, | |
54 generator = "SEQUENCE_MAIN_VALUES_ID_SEQ") | |
55 @Column(name = "id") | |
56 public Integer getId() { | |
57 return id; | |
58 } | |
59 | |
60 public void setId(Integer id) { | |
61 this.id = id; | |
62 } | |
63 | |
64 @OneToOne | |
65 @JoinColumn(name = "gauge_id") | |
66 public Gauge getGauge() { | |
67 return gauge; | |
68 } | |
69 | |
70 public void setGauge(Gauge gauge) { | |
71 this.gauge = gauge; | |
72 } | |
73 | |
74 @OneToOne | |
75 @JoinColumn(name = "named_value_id") | |
76 public NamedMainValue getMainValue() { | |
77 return mainValue; | |
78 } | |
79 | |
80 public void setMainValue(NamedMainValue mainValue) { | |
81 this.mainValue = mainValue; | |
82 } | |
83 | |
84 @Column(name = "value") // FIXME: type mapping needed? | |
85 public BigDecimal getValue() { | |
86 return value; | |
87 } | |
88 | |
89 public void setValue(BigDecimal value) { | |
90 this.value = value; | |
91 } | |
92 | |
93 @OneToOne | |
94 @JoinColumn(name = "time_interval_id") | |
95 public TimeInterval getTimeInterval() { | |
96 return timeInterval; | |
97 } | |
98 | |
99 public void setTimeInterval(TimeInterval timeInterval) { | |
100 this.timeInterval = timeInterval; | |
101 } | |
102 } | |
103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |