comparison flys-backend/src/main/java/de/intevation/flys/model/SedimentDensityValue.java @ 2812:a36a5407acbf

Improved the MINFO db schema and added model classes for storing sediment density values specific to a river and depth. flys-backend/trunk@4228 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 13 Apr 2012 08:16:55 +0000
parents
children 8979f2294af9
comparison
equal deleted inserted replaced
2811:8926571e47fb 2812:a36a5407acbf
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4 import java.math.BigDecimal;
5
6 import javax.persistence.Entity;
7 import javax.persistence.Id;
8 import javax.persistence.Table;
9 import javax.persistence.GeneratedValue;
10 import javax.persistence.Column;
11 import javax.persistence.SequenceGenerator;
12 import javax.persistence.GenerationType;
13 import javax.persistence.JoinColumn;
14 import javax.persistence.OneToOne;
15
16
17 @Entity
18 @Table(name = "sediment_density_values")
19 public class SedimentDensityValue implements Serializable {
20
21 private Integer id;
22
23 private Range station;
24
25 private BigDecimal density;
26
27 private String description;
28
29
30 public SedimentDensityValue() {
31 }
32
33
34 public SedimentDensityValue(Range station, BigDecimal density, String desc) {
35 this.station = station;
36 this.density = density;
37 this.description = desc;
38 }
39
40 @Id
41 @SequenceGenerator(
42 name = "SEQUENCE_SEDIMENT_DENSITY_VALUES_ID_SEQ",
43 sequenceName = "SEDIMENT_DENSITY_VALUES_ID_SEQ",
44 allocationSize = 1)
45 @GeneratedValue(
46 strategy = GenerationType.SEQUENCE,
47 generator = "SEQUENCE_SEDIMENT_DENSITY_VALUES_ID_SEQ")
48 @Column(name = "id")
49 public Integer getId() {
50 return id;
51 }
52
53 public void setId(Integer id) {
54 this.id = id;
55 }
56
57 @OneToOne
58 @JoinColumn(name = "station_id")
59 public Range getStation() {
60 return station;
61 }
62
63 public void setStation(Range station) {
64 this.station = station;
65 }
66
67 @Column(name = "density")
68 public BigDecimal getDensity() {
69 return density;
70 }
71
72 public void setDensity(BigDecimal density) {
73 this.density = density;
74 }
75
76 @Column(name = "description")
77 public String getDescription() {
78 return description;
79 }
80
81 public void setDescription(String description) {
82 this.description = description;
83 }
84 }
85 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org