Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/CollisionValue.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 | 623b51bf03d7 |
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 collision_values | |
29 * | |
30 * @author Matthias Schäfer | |
31 * | |
32 */ | |
33 @Entity | |
34 @Table(name = "collision_values") | |
35 public class CollisionValue implements Serializable { | |
36 | |
37 /***** FIELDS *****/ | |
38 | |
39 private static final long serialVersionUID = -1157324854470346513L; | |
40 | |
41 private Integer id; | |
42 | |
43 private Collision collision; | |
44 | |
45 private Double station; | |
46 | |
47 private CollisionType collisionType; | |
48 | |
49 private Date eventDate; | |
50 | |
51 private String gaugeName; | |
52 | |
53 private Double gaugeW; | |
54 | |
55 | |
56 /***** CONSTRUCTORS *****/ | |
57 | |
58 public CollisionValue() { | |
59 } | |
60 | |
61 public CollisionValue(final Collision collision, final Double station, final CollisionType collisionType, final Date eventDate, final String gaugeName, | |
62 final Double gaugeW) { | |
63 this.collision = collision; | |
64 this.station = station; | |
65 this.collisionType = collisionType; | |
66 this.eventDate = eventDate; | |
67 this.gaugeName = gaugeName; | |
68 this.gaugeW = gaugeW; | |
69 } | |
70 | |
71 /** | |
72 * Constructor with primitive parameter types | |
73 */ | |
74 public CollisionValue(final Collision collision, final double km, final CollisionType collisionType, final Date eventDate, final String gaugeName, | |
75 final double gaugeW) { | |
76 this(collision, Double.valueOf(km), collisionType, eventDate, gaugeName, Double.valueOf(gaugeW)); | |
77 } | |
78 | |
79 | |
80 /***** METHODS *****/ | |
81 | |
82 @Id | |
83 @SequenceGenerator(name = "SEQUENCE_COLLISION_VALUE_ID_SEQ", sequenceName = "COLLISION_VALUES_ID_SEQ", allocationSize = 1) | |
84 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_COLLISION_VALUE_ID_SEQ") | |
85 @Column(name = "id") | |
86 public Integer getId() { | |
87 return this.id; | |
88 } | |
89 | |
90 public void setId(final Integer id) { | |
91 this.id = id; | |
92 } | |
93 | |
94 @OneToOne | |
95 @JoinColumn(name = "collision_id") | |
96 public Collision getCollision() { | |
97 return this.collision; | |
98 } | |
99 | |
100 public void setCollision(final Collision collision) { | |
101 this.collision = collision; | |
102 } | |
103 | |
104 @Column(name = "station") | |
105 public Double getStation() { | |
106 return this.station; | |
107 } | |
108 | |
109 public void setStation(final Double station) { | |
110 this.station = station; | |
111 } | |
112 | |
113 @OneToOne | |
114 @JoinColumn(name = "collision_type_id") | |
115 public CollisionType getCollisionType() { | |
116 return this.collisionType; | |
117 } | |
118 | |
119 public void setCollisionType(final CollisionType collisionType) { | |
120 this.collisionType = collisionType; | |
121 } | |
122 | |
123 @Column(name = "event_date") | |
124 public Date getEventDate() { | |
125 return this.eventDate; | |
126 } | |
127 | |
128 public void setEventDate(final Date eventDate) { | |
129 this.eventDate = eventDate; | |
130 } | |
131 | |
132 @Column(name = "gauge_name") | |
133 public String getGaugeName() { | |
134 return this.gaugeName; | |
135 } | |
136 | |
137 public void setGaugeName(final String gaugeName) { | |
138 this.gaugeName = gaugeName; | |
139 } | |
140 | |
141 @Column(name = "gauge_w") | |
142 public Double getGaugeW() { | |
143 return this.gaugeW; | |
144 } | |
145 | |
146 public void setGaugeW(final Double gaugeW) { | |
147 this.gaugeW = gaugeW; | |
148 } | |
149 } |