comparison flys-backend/src/main/java/de/intevation/flys/model/SedimentYield.java @ 2877:f0a67bc0e777 2.7

merged flys-backend/2.7
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:31 +0200
parents 71175502d868
children
comparison
equal deleted inserted replaced
2793:6310b1582f2d 2877:f0a67bc0e777
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.persistence.Entity;
8 import javax.persistence.Id;
9 import javax.persistence.Table;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.Column;
12 import javax.persistence.SequenceGenerator;
13 import javax.persistence.GenerationType;
14 import javax.persistence.JoinColumn;
15 import javax.persistence.OneToOne;
16
17 import org.apache.log4j.Logger;
18
19
20 @Entity
21 @Table(name = "sediment_yield")
22 public class SedimentYield
23 implements Serializable
24 {
25 private static Logger logger = Logger.getLogger(SedimentYield.class);
26
27 private Integer id;
28
29 private River river;
30
31 private GrainFraction grainFraction;
32
33 private Unit unit;
34
35 private TimeInterval timeInterval;
36
37 private String description;
38
39 private List<SedimentYieldValue> values;
40
41
42 public SedimentYield() {
43 this.values = new ArrayList<SedimentYieldValue>();
44 }
45
46 public SedimentYield(River river, Unit unit, TimeInterval timeInterval) {
47 this();
48
49 this.river = river;
50 this.unit = unit;
51 this.timeInterval = timeInterval;
52 }
53
54
55 public SedimentYield(
56 River river,
57 Unit unit,
58 TimeInterval timeInterval,
59 GrainFraction grainFraction
60 ) {
61 this(river, unit, timeInterval);
62
63 this.grainFraction = grainFraction;
64 }
65
66
67 public SedimentYield(
68 River river,
69 Unit unit,
70 TimeInterval timeInterval,
71 GrainFraction grainFraction,
72 String description
73 ) {
74 this(river, unit, timeInterval, grainFraction);
75
76 this.description = description;
77 }
78
79 @Id
80 @SequenceGenerator(
81 name = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ",
82 sequenceName = "SEDIMENT_YIELD_ID_SEQ",
83 allocationSize = 1)
84 @GeneratedValue(
85 strategy = GenerationType.SEQUENCE,
86 generator = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ")
87 @Column(name = "id")
88 public Integer getId() {
89 return id;
90 }
91
92 public void setId(Integer id) {
93 this.id = id;
94 }
95
96 @OneToOne
97 @JoinColumn(name = "river_id")
98 public River getRiver() {
99 return river;
100 }
101
102 public void setRiver(River river) {
103 this.river = river;
104 }
105
106 @OneToOne
107 @JoinColumn(name="grain_fraction_id")
108 public GrainFraction getGrainFraction() {
109 return grainFraction;
110 }
111
112 public void setGrainFraction(GrainFraction grainFraction) {
113 this.grainFraction = grainFraction;
114 }
115
116 @OneToOne
117 @JoinColumn(name = "unit_id")
118 public Unit getUnit() {
119 return unit;
120 }
121
122 public void setUnit(Unit unit) {
123 this.unit = unit;
124 }
125
126 @OneToOne
127 @JoinColumn(name = "time_interval_id")
128 public TimeInterval getTimeInterval() {
129 return timeInterval;
130 }
131
132 public void setTimeInterval(TimeInterval timeInterval) {
133 this.timeInterval = timeInterval;
134 }
135
136 @Column(name = "description")
137 public String getDescription() {
138 return description;
139 }
140
141 public void setDescription(String description) {
142 this.description = description;
143 }
144 }
145 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org