comparison backend/src/main/java/org/dive4elements/river/model/Porosity.java @ 7840:02711de579cc

Added model, parser and importer for porosities.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 30 Apr 2014 14:11:29 +0200
parents
children
comparison
equal deleted inserted replaced
7839:3f6b9fae1637 7840:02711de579cc
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU AGPL (>=v3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
6 * documentation coming with Dive4Elements River for details.
7 */
8
9 package org.dive4elements.river.model;
10
11 import java.io.Serializable;
12 import java.util.List;
13
14 import javax.persistence.Entity;
15 import javax.persistence.Id;
16 import javax.persistence.Table;
17 import javax.persistence.GeneratedValue;
18 import javax.persistence.Column;
19 import javax.persistence.SequenceGenerator;
20 import javax.persistence.GenerationType;
21 import javax.persistence.JoinColumn;
22 import javax.persistence.OneToOne;
23 import javax.persistence.OneToMany;
24
25
26 @Entity
27 @Table(name = "porosity")
28 public class Porosity implements Serializable {
29
30 private Integer id;
31
32 private River river;
33
34 private Depth depth;
35
36 private List<PorosityValue> values;
37
38 private String description;
39
40 private TimeInterval timeInterval;
41
42 public Porosity() {
43 }
44
45
46 public Porosity(
47 River river,
48 Depth depth,
49 String desc,
50 TimeInterval timeInterval
51 ) {
52 this.river = river;
53 this.depth = depth;
54 this.description = desc;
55 this.timeInterval = timeInterval;
56 }
57
58 @Id
59 @SequenceGenerator(
60 name = "SEQUENCE_POROSITY_ID_SEQ",
61 sequenceName = "POROSITY_ID_SEQ",
62 allocationSize = 1)
63 @GeneratedValue(
64 strategy = GenerationType.SEQUENCE,
65 generator = "SEQUENCE_POROSITY_ID_SEQ")
66 @Column(name = "id")
67 public Integer getId() {
68 return id;
69 }
70
71 public void setId(Integer id) {
72 this.id = id;
73 }
74
75 @OneToOne
76 @JoinColumn(name = "river_id" )
77 public River getRiver() {
78 return river;
79 }
80
81 public void setRiver(River river) {
82 this.river = river;
83 }
84
85 @OneToOne
86 @JoinColumn(name = "depth_id")
87 public Depth getDepth() {
88 return depth;
89 }
90
91 public void setDepth(Depth depth) {
92 this.depth = depth;
93 }
94
95 @Column(name = "description")
96 public String getDescription() {
97 return description;
98 }
99
100 public void setDescription(String description) {
101 this.description = description;
102 }
103
104 @OneToOne
105 @JoinColumn(name = "time_interval_id")
106 public TimeInterval getTimeInterval() {
107 return timeInterval;
108 }
109
110 public void setTimeInterval(TimeInterval timeInterval) {
111 this.timeInterval = timeInterval;
112 }
113
114 @OneToMany
115 @JoinColumn(name="porosity_id")
116 public List<PorosityValue> getValues() {
117 return values;
118 }
119
120 public void setValues(List<PorosityValue> values) {
121 this.values = values;
122 }
123
124 public void addValue(PorosityValue value) {
125 this.values.add(value);
126 }
127 }
128 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org