Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/SedimentLoadValue.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 | |
12 import javax.persistence.Column; | |
13 import javax.persistence.Entity; | |
14 import javax.persistence.GeneratedValue; | |
15 import javax.persistence.GenerationType; | |
16 import javax.persistence.Id; | |
17 import javax.persistence.JoinColumn; | |
18 import javax.persistence.OneToOne; | |
19 import javax.persistence.SequenceGenerator; | |
20 import javax.persistence.Table; | |
21 | |
22 @Entity | |
23 @Table(name = "sediment_load_value") | |
24 public class SedimentLoadValue | |
25 implements Serializable | |
26 { | |
27 private Integer id; | |
28 | |
29 private SedimentLoad sedimentLoad; | |
30 | |
31 private MeasurementStation measurementStation; | |
32 | |
33 private Double value; | |
34 | |
35 public SedimentLoadValue() { | |
36 } | |
37 | |
38 @Id | |
39 @SequenceGenerator( | |
40 name = "SEQUENCE_SEDIMENT_LOAD_VALUES_ID_SEQ", | |
41 sequenceName = "SEDIMENT_LOAD_VALUES_ID_SEQ", | |
42 allocationSize = 1) | |
43 @GeneratedValue( | |
44 strategy = GenerationType.SEQUENCE, | |
45 generator = "SEQUENCE_SEDIMENT_LOAD_VALUES_ID_SEQ") | |
46 @Column(name = "id") | |
47 public Integer getId() { | |
48 return id; | |
49 } | |
50 | |
51 public void setId(Integer id) { | |
52 this.id = id; | |
53 } | |
54 | |
55 @OneToOne | |
56 @JoinColumn(name = "sediment_load_id") | |
57 public SedimentLoad getSedimentLoad() { | |
58 return sedimentLoad; | |
59 } | |
60 | |
61 public void setSedimentLoad(SedimentLoad sedimentLoad) { | |
62 this.sedimentLoad = sedimentLoad; | |
63 } | |
64 | |
65 @OneToOne | |
66 @JoinColumn(name = "measurement_station_id") | |
67 public MeasurementStation getMeasurementStation() { | |
68 return measurementStation; | |
69 } | |
70 | |
71 public void setMeasurementStation(MeasurementStation measurementStation) { | |
72 this.measurementStation = measurementStation; | |
73 } | |
74 | |
75 @Column(name = "value") | |
76 public Double getValue() { | |
77 return value; | |
78 } | |
79 | |
80 public void setValue(Double value) { | |
81 this.value = value; | |
82 } | |
83 } | |
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |