Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/ChannelValue.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 | 189cc8ededbd |
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 | |
15 import javax.persistence.Column; | |
16 import javax.persistence.Entity; | |
17 import javax.persistence.GeneratedValue; | |
18 import javax.persistence.GenerationType; | |
19 import javax.persistence.Id; | |
20 import javax.persistence.JoinColumn; | |
21 import javax.persistence.OneToOne; | |
22 import javax.persistence.SequenceGenerator; | |
23 import javax.persistence.Table; | |
24 | |
25 | |
26 /** | |
27 * Hibernate binding for the DB table channel_values | |
28 * | |
29 * @author Matthias Schäfer | |
30 * | |
31 */ | |
32 @Entity | |
33 @Table(name = "channel_values") | |
34 public class ChannelValue implements Serializable { | |
35 | |
36 /***** FIELDS *****/ | |
37 | |
38 private static final long serialVersionUID = -3793243094875530557L; | |
39 | |
40 private Integer id; | |
41 | |
42 private Channel channel; | |
43 | |
44 private Double station; | |
45 | |
46 private Double width; | |
47 | |
48 private Double depth; | |
49 | |
50 | |
51 /***** CONSTRUCTORS *****/ | |
52 | |
53 public ChannelValue() { | |
54 } | |
55 | |
56 public ChannelValue(final Channel channel, final Double station, final Double width, final Double depth) { | |
57 this.channel = channel; | |
58 this.station = station; | |
59 this.width = width; | |
60 this.depth = depth; | |
61 } | |
62 | |
63 /** | |
64 * Parameter constructor with primitive parameter types | |
65 */ | |
66 public ChannelValue(final Channel channel, final double km, final double width, final double depth) { | |
67 this(channel, Double.valueOf(km), Double.valueOf(width), Double.valueOf(depth)); | |
68 } | |
69 | |
70 | |
71 /***** METHODS *****/ | |
72 | |
73 @Id | |
74 @SequenceGenerator(name = "SEQUENCE_CHANNEL_VALUE_ID_SEQ", sequenceName = "CHANNEL_VALUES_ID_SEQ", allocationSize = 1) | |
75 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_CHANNEL_VALUE_ID_SEQ") | |
76 @Column(name = "id") | |
77 public Integer getId() { | |
78 return this.id; | |
79 } | |
80 | |
81 public void setId(final Integer id) { | |
82 this.id = id; | |
83 } | |
84 | |
85 @OneToOne | |
86 @JoinColumn(name = "channel_id") | |
87 public Channel getChannel() { | |
88 return this.channel; | |
89 } | |
90 | |
91 public void setChannel(final Channel channel) { | |
92 this.channel = channel; | |
93 } | |
94 | |
95 @Column(name = "station") | |
96 public Double getStation() { | |
97 return this.station; | |
98 } | |
99 | |
100 public void setStation(final Double station) { | |
101 this.station = station; | |
102 } | |
103 | |
104 @Column(name = "width") | |
105 public Double getWidth() { | |
106 return this.width; | |
107 } | |
108 | |
109 public void setWidth(final Double width) { | |
110 this.width = width; | |
111 } | |
112 | |
113 @Column(name = "depth") | |
114 public Double getDepth() { | |
115 return this.depth; | |
116 } | |
117 | |
118 public void setDepth(final Double depth) { | |
119 this.depth = depth; | |
120 } | |
121 } |