Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Depth.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 | a36a5407acbf |
children | 7c1dd9c3f6bd |
comparison
equal
deleted
inserted
replaced
2793:6310b1582f2d | 2877:f0a67bc0e777 |
---|---|
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 = "depths") | |
19 public class Depth implements Serializable { | |
20 | |
21 private Integer id; | |
22 | |
23 private BigDecimal lower; | |
24 private BigDecimal upper; | |
25 | |
26 private Unit unit; | |
27 | |
28 | |
29 public Depth() { | |
30 } | |
31 | |
32 | |
33 public Depth(BigDecimal lower, BigDecimal upper, Unit unit) { | |
34 this.lower = lower; | |
35 this.upper = upper; | |
36 this.unit = unit; | |
37 } | |
38 | |
39 @Id | |
40 @SequenceGenerator( | |
41 name = "SEQUENCE_DEPTHS_ID_SEQ", | |
42 sequenceName = "DEPTHS_ID_SEQ", | |
43 allocationSize = 1) | |
44 @GeneratedValue( | |
45 strategy = GenerationType.SEQUENCE, | |
46 generator = "SEQUENCE_DEPTHS_ID_SEQ") | |
47 @Column(name = "id") | |
48 public Integer getId() { | |
49 return id; | |
50 } | |
51 | |
52 public void setId(Integer id) { | |
53 this.id = id; | |
54 } | |
55 | |
56 @Column(name = "lower") | |
57 public BigDecimal getLower() { | |
58 return lower; | |
59 } | |
60 | |
61 public void setLower(BigDecimal lower) { | |
62 this.lower = lower; | |
63 } | |
64 | |
65 @Column(name = "upper") | |
66 public BigDecimal getUpper() { | |
67 return upper; | |
68 } | |
69 | |
70 public void setUpper(BigDecimal upper) { | |
71 this.upper = upper; | |
72 } | |
73 | |
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 } | |
84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |