comparison backend/src/main/java/org/dive4elements/river/model/SedimentLoad.java @ 8026:4b3054edbbaf

Added Hibernate mappings for new sediment load database model.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 10 Jul 2014 12:04:56 +0200
parents
children aa054f72e887
comparison
equal deleted inserted replaced
8025:c915e99d9e52 8026:4b3054edbbaf
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 package org.dive4elements.river.model;
9
10 import java.io.Serializable;
11 import java.util.List;
12
13 import javax.persistence.Column;
14 import javax.persistence.Entity;
15 import javax.persistence.GeneratedValue;
16 import javax.persistence.GenerationType;
17 import javax.persistence.Id;
18 import javax.persistence.JoinColumn;
19 import javax.persistence.OneToMany;
20 import javax.persistence.OneToOne;
21 import javax.persistence.SequenceGenerator;
22 import javax.persistence.Table;
23
24 @Entity
25 @Table(name = "sediment_load")
26 public class SedimentLoad
27 implements Serializable
28 {
29 private Integer id;
30
31 private GrainFraction grainFraction;
32
33 private TimeInterval timeInterval;
34
35 private TimeInterval sqTimeInterval;
36
37 private String description;
38
39 private Integer kind;
40
41 private List<SedimentLoadValue> values;
42
43 public SedimentLoad() {
44 }
45
46 @Id
47 @SequenceGenerator(
48 name = "SEQUENCE_SEDIMENT_LOAD_ID_SEQ",
49 sequenceName = "SEDIMENT_LOAD_ID_SEQ",
50 allocationSize = 1)
51 @GeneratedValue(
52 strategy = GenerationType.SEQUENCE,
53 generator = "SEQUENCE_SEDIMENT_LOAD_ID_SEQ")
54 @Column(name = "id")
55 public Integer getId() {
56 return id;
57 }
58
59 public void setId(Integer id) {
60 this.id = id;
61 }
62
63 @OneToOne
64 @JoinColumn(name="grain_fraction_id")
65 public GrainFraction getGrainFraction() {
66 return grainFraction;
67 }
68
69 public void setGrainFraction(GrainFraction grainFraction) {
70 this.grainFraction = grainFraction;
71 }
72
73 @OneToOne
74 @JoinColumn(name = "time_interval_id")
75 public TimeInterval getTimeInterval() {
76 return timeInterval;
77 }
78
79 public void setTimeInterval(TimeInterval timeInterval) {
80 this.timeInterval = timeInterval;
81 }
82
83 @OneToOne
84 @JoinColumn(name = "sq_time_interval_id")
85 public TimeInterval getSQTimeInterval() {
86 return sqTimeInterval;
87 }
88
89 public void setSQTimeInterval(TimeInterval sqTimeInterval) {
90 this.sqTimeInterval = sqTimeInterval;
91 }
92
93 @Column(name = "description")
94 public String getDescription() {
95 return description;
96 }
97
98 public void setDescription(String description) {
99 this.description = description;
100 }
101
102 /** kind == 0: "normal", kind == 1: "official epoch". */
103 @Column(name = "kind")
104 public Integer getKind() {
105 return kind;
106 }
107
108 public void setKind(Integer newKind) {
109 this.kind = newKind;
110 }
111
112 @OneToMany
113 @JoinColumn(name="sediment_load_id")
114 public List<SedimentLoadValue> getSedimentLoadValues() {
115 return values;
116 }
117
118 public void setSedimentLoadValues(List<SedimentLoadValue> values) {
119 this.values = values;
120 }
121 }
122 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org