comparison flys-backend/src/main/java/de/intevation/flys/model/Depth.java @ 5441:7c1dd9c3f6bd

remove unit from sediment density and depths (always t/m3 respectively cm, otherwise a typo)
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 26 Mar 2013 19:29:39 +0100
parents a36a5407acbf
children
comparison
equal deleted inserted replaced
5440:765013c837b1 5441:7c1dd9c3f6bd
8 import javax.persistence.Table; 8 import javax.persistence.Table;
9 import javax.persistence.GeneratedValue; 9 import javax.persistence.GeneratedValue;
10 import javax.persistence.Column; 10 import javax.persistence.Column;
11 import javax.persistence.SequenceGenerator; 11 import javax.persistence.SequenceGenerator;
12 import javax.persistence.GenerationType; 12 import javax.persistence.GenerationType;
13 import javax.persistence.JoinColumn;
14 import javax.persistence.OneToOne;
15 13
16 14
17 @Entity 15 @Entity
18 @Table(name = "depths") 16 @Table(name = "depths")
19 public class Depth implements Serializable { 17 public class Depth implements Serializable {
21 private Integer id; 19 private Integer id;
22 20
23 private BigDecimal lower; 21 private BigDecimal lower;
24 private BigDecimal upper; 22 private BigDecimal upper;
25 23
26 private Unit unit;
27
28 24
29 public Depth() { 25 public Depth() {
30 } 26 }
31 27
32 28
33 public Depth(BigDecimal lower, BigDecimal upper, Unit unit) { 29 public Depth(BigDecimal lower, BigDecimal upper) {
34 this.lower = lower; 30 this.lower = lower;
35 this.upper = upper; 31 this.upper = upper;
36 this.unit = unit;
37 } 32 }
38 33
39 @Id 34 @Id
40 @SequenceGenerator( 35 @SequenceGenerator(
41 name = "SEQUENCE_DEPTHS_ID_SEQ", 36 name = "SEQUENCE_DEPTHS_ID_SEQ",
69 64
70 public void setUpper(BigDecimal upper) { 65 public void setUpper(BigDecimal upper) {
71 this.upper = upper; 66 this.upper = upper;
72 } 67 }
73 68
74 @OneToOne
75 @JoinColumn(name = "unit_id")
76 public Unit getUnit() {
77 return unit;
78 }
79
80 public void setUnit(Unit unit) {
81 this.unit = unit;
82 }
83 } 69 }
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 70 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org