Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/sinfo/FlowDepthColumn.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 | c16e90a0baf7 |
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.List; | |
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.OneToMany; | |
23 import javax.persistence.OneToOne; | |
24 import javax.persistence.SequenceGenerator; | |
25 import javax.persistence.Table; | |
26 | |
27 /** | |
28 * Hibernate binding for the DB table flow_depth_column | |
29 * | |
30 * @author Matthias Schäfer | |
31 * | |
32 */ | |
33 @Entity | |
34 @Table(name = "flow_depth_column") | |
35 public class FlowDepthColumn implements Serializable { | |
36 | |
37 /***** FIELDS *****/ | |
38 | |
39 private static final long serialVersionUID = -8164345503234852700L; | |
40 | |
41 private Integer id; | |
42 | |
43 private FlowDepth parent; | |
44 | |
45 private String name; | |
46 | |
47 private List<FlowDepthValue> values; | |
48 | |
49 | |
50 /***** CONSTRUCTORS *****/ | |
51 | |
52 public FlowDepthColumn() { | |
53 } | |
54 | |
55 public FlowDepthColumn(final FlowDepth parent, final String name) { | |
56 this.parent = parent; | |
57 this.name = name; | |
58 } | |
59 | |
60 /***** METHODS *****/ | |
61 | |
62 @Id | |
63 @SequenceGenerator(name = "SEQUENCE_FLOW_DEPTH_COLUMN_ID_SEQ", sequenceName = "FLOW_DEPTH_COLUMN_ID_SEQ", allocationSize = 1) | |
64 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_FLOW_DEPTH_COLUMN_ID_SEQ") | |
65 @Column(name = "id") | |
66 public Integer getId() { | |
67 return this.id; | |
68 } | |
69 | |
70 public void setId(final Integer id) { | |
71 this.id = id; | |
72 } | |
73 | |
74 @OneToOne | |
75 @JoinColumn(name = "flow_depth_id") | |
76 public FlowDepth getFlowDepth() { | |
77 return this.parent; | |
78 } | |
79 | |
80 public void setFlowDepth(final FlowDepth flow_depth) { | |
81 this.parent = flow_depth; | |
82 } | |
83 | |
84 @Column(name = "name") | |
85 public String getName() { | |
86 return this.name; | |
87 } | |
88 | |
89 public void setName(final String name) { | |
90 this.name = name; | |
91 } | |
92 | |
93 @OneToMany | |
94 @JoinColumn(name = "flow_depth_column_id") | |
95 public List<FlowDepthValue> getValues() { | |
96 return this.values; | |
97 } | |
98 | |
99 public void setValues(final List<FlowDepthValue> values) { | |
100 this.values = values; | |
101 } | |
102 | |
103 public void addValue(final FlowDepthValue value) { | |
104 this.values.add(value); | |
105 } | |
106 } |