comparison backend/src/main/java/org/dive4elements/river/model/sinfo/InfrastructureValue.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 a165cd63099f
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 import org.dive4elements.river.model.Attribute;
26
27
28 /**
29 * Hibernate binding for the DB table infrastructure_values
30 *
31 * @author Matthias Schäfer
32 *
33 */
34 @Entity
35 @Table(name = "infrastructure_values")
36 public class InfrastructureValue implements Serializable {
37
38 /***** FIELDS *****/
39
40 private static final long serialVersionUID = -3887269325288851829L;
41
42 private Integer id;
43
44 private Infrastructure infrastructure;
45
46 private Double station;
47
48 private Attribute attribute;
49
50 private Double height;
51
52
53 /***** CONSTRUCTORS *****/
54
55 public InfrastructureValue() {
56 }
57
58 public InfrastructureValue(final Infrastructure infrastructure, final Double station, final Attribute attribute, final Double height) {
59 this.infrastructure = infrastructure;
60 this.station = station;
61 this.attribute = attribute;
62 this.height = height;
63 }
64
65 /**
66 * Parameter constructor with primitive double km and height
67 */
68 public InfrastructureValue(final Infrastructure infrastructure, final double km, final Attribute attribute, final double height) {
69 this(infrastructure, Double.valueOf(km), attribute, Double.valueOf(height));
70 }
71
72
73 /***** METHODS *****/
74
75 @Id
76 @SequenceGenerator(name = "SEQUENCE_INFRASTRUCTURE_VALUE_ID_SEQ", sequenceName = "INFRASTRUCTURE_VALUES_ID_SEQ", allocationSize = 1)
77 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_INFRASTRUCTURE_VALUE_ID_SEQ")
78 @Column(name = "id")
79 public Integer getId() {
80 return this.id;
81 }
82
83 public void setId(final Integer id) {
84 this.id = id;
85 }
86
87 @OneToOne
88 @JoinColumn(name = "infrastructure_id")
89 public Infrastructure getInfrastructure() {
90 return this.infrastructure;
91 }
92
93 public void setInfrastructure(final Infrastructure infrastructure) {
94 this.infrastructure = infrastructure;
95 }
96
97 @Column(name = "station")
98 public Double getStation() {
99 return this.station;
100 }
101
102 public void setStation(final Double station) {
103 this.station = station;
104 }
105
106 @OneToOne
107 @JoinColumn(name = "attribute_id")
108 public Attribute getAttribute() {
109 return this.attribute;
110 }
111
112 public void setAttribute(final Attribute attribute) {
113 this.attribute = attribute;
114 }
115
116 @Column(name = "height")
117 public Double getHeight() {
118 return this.height;
119 }
120
121 public void setHeight(final Double height) {
122 this.height = height;
123 }
124 }

http://dive4elements.wald.intevation.org