Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/BedMobilityValue.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 | 6e5ff436febe |
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 bed_mobility_values | |
28 * | |
29 * @author Matthias Schäfer | |
30 * | |
31 */ | |
32 @Entity | |
33 @Table(name = "bed_mobility_values") | |
34 public class BedMobilityValue implements Serializable { | |
35 | |
36 /***** FIELDS *****/ | |
37 | |
38 private static final long serialVersionUID = 1784382276688203055L; | |
39 | |
40 private Integer id; | |
41 | |
42 private BedMobility bedMobility; | |
43 | |
44 private Double station; | |
45 | |
46 private int moving; /* 0 or 1 */ | |
47 | |
48 | |
49 /***** CONSTRUCTORS *****/ | |
50 | |
51 public BedMobilityValue() { | |
52 } | |
53 | |
54 public BedMobilityValue(final BedMobility bedMobility, final Double station, final int bedMoving) { | |
55 this.bedMobility = bedMobility; | |
56 this.station = station; | |
57 this.moving = bedMoving; | |
58 } | |
59 | |
60 /** | |
61 * Parameter constructor with primitive double km and boolean | |
62 */ | |
63 public BedMobilityValue(final BedMobility bedMobility, final double km, final boolean bedMoving) { | |
64 this(bedMobility, Double.valueOf(km), (bedMoving ? 1 : 0)); | |
65 } | |
66 | |
67 | |
68 /***** METHODS *****/ | |
69 | |
70 @Id | |
71 @SequenceGenerator(name = "SEQUENCE_BED_MOBILITY_VALUE_ID_SEQ", sequenceName = "BED_MOBILITY_VALUES_ID_SEQ", allocationSize = 1) | |
72 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_BED_MOBILITY_VALUE_ID_SEQ") | |
73 @Column(name = "id") | |
74 public Integer getId() { | |
75 return this.id; | |
76 } | |
77 | |
78 public void setId(final Integer id) { | |
79 this.id = id; | |
80 } | |
81 | |
82 @OneToOne | |
83 @JoinColumn(name = "bed_mobility_id") | |
84 public BedMobility getBedMobility() { | |
85 return this.bedMobility; | |
86 } | |
87 | |
88 public void setBedMobility(final BedMobility bedMobility) { | |
89 this.bedMobility = bedMobility; | |
90 } | |
91 | |
92 @Column(name = "station") | |
93 public Double getStation() { | |
94 return this.station; | |
95 } | |
96 | |
97 public void setStation(final Double station) { | |
98 this.station = station; | |
99 } | |
100 | |
101 @Column(name = "moving") | |
102 public int getMoving() { | |
103 return this.moving; | |
104 } | |
105 | |
106 public void setMoving(final int bedMoving) { | |
107 this.moving = bedMoving; | |
108 } | |
109 } |