Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/DailyDischargeValue.java @ 8971:50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author | mschaefer |
---|---|
date | Tue, 03 Apr 2018 10:18:30 +0200 |
parents | |
children | e4a6679b868f |
comparison
equal
deleted
inserted
replaced
8970:da5dc7446652 | 8971:50416a0df385 |
---|---|
1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.model.sinfo; | |
12 | |
13 import java.io.Serializable; | |
14 import java.util.Date; | |
15 | |
16 import javax.persistence.Column; | |
17 import javax.persistence.Entity; | |
18 import javax.persistence.GeneratedValue; | |
19 import javax.persistence.GenerationType; | |
20 import javax.persistence.Id; | |
21 import javax.persistence.JoinColumn; | |
22 import javax.persistence.OneToOne; | |
23 import javax.persistence.SequenceGenerator; | |
24 import javax.persistence.Table; | |
25 | |
26 | |
27 /** | |
28 * Hibernate binding for the DB table daily_discharge_values | |
29 * | |
30 * @author Matthias Schäfer | |
31 * | |
32 */ | |
33 @Entity | |
34 @Table(name = "daily_discharge_values") | |
35 public class DailyDischargeValue implements Serializable { | |
36 | |
37 /***** FIELDS *****/ | |
38 | |
39 private static final long serialVersionUID = -6192738825193230784L; | |
40 | |
41 private Integer id; | |
42 | |
43 private DailyDischarge dailyDischarge; | |
44 | |
45 private Date day; | |
46 | |
47 private Double discharge; | |
48 | |
49 | |
50 /***** CONSTRUCTORS *****/ | |
51 | |
52 public DailyDischargeValue() { | |
53 } | |
54 | |
55 public DailyDischargeValue(final DailyDischarge dailyDischarge, final Date day, final Double discharge) { | |
56 this.dailyDischarge = dailyDischarge; | |
57 this.day = day; | |
58 this.discharge = discharge; | |
59 } | |
60 | |
61 /** | |
62 * Parameter constructor with primitive parameter types | |
63 */ | |
64 public DailyDischargeValue(final DailyDischarge dailyDischarge, final Date day, final double discharge) { | |
65 this(dailyDischarge, day, Double.valueOf(discharge)); | |
66 } | |
67 | |
68 | |
69 /***** METHODS *****/ | |
70 | |
71 @Id | |
72 @SequenceGenerator(name = "SEQUENCE_DAILY_DISCHARGE_VALUE_ID_SEQ", sequenceName = "DAILY_DISCHARGE_VALUES_ID_SEQ", allocationSize = 1) | |
73 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_DAILY_DISCHARGE_VALUE_ID_SEQ") | |
74 @Column(name = "id") | |
75 public Integer getId() { | |
76 return this.id; | |
77 } | |
78 | |
79 public void setId(final Integer id) { | |
80 this.id = id; | |
81 } | |
82 | |
83 @OneToOne | |
84 @JoinColumn(name = "daily_discharge_id") | |
85 public DailyDischarge getDailyDischarge() { | |
86 return this.dailyDischarge; | |
87 } | |
88 | |
89 public void setDailyDischarge(final DailyDischarge dailyDischarge) { | |
90 this.dailyDischarge = dailyDischarge; | |
91 } | |
92 | |
93 @Column(name = "discharge") | |
94 public Double getDischarge() { | |
95 return this.discharge; | |
96 } | |
97 | |
98 public void setDischarge(final Double discharge) { | |
99 this.discharge = discharge; | |
100 } | |
101 | |
102 @Column(name = "day") | |
103 public Date getDay() { | |
104 return this.day; | |
105 } | |
106 | |
107 public void setDay(final Date day) { | |
108 this.day = day; | |
109 } | |
110 } |