comparison flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 171:4a83e14f40f9

Added entity and id annotations. flys-backend/trunk@1463 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 14 Mar 2011 14:52:58 +0000
parents 86a1bd9cc50e
children 605320b7df94
comparison
equal deleted inserted replaced
170:88c14d5d45be 171:4a83e14f40f9
2 2
3 import java.math.BigDecimal; 3 import java.math.BigDecimal;
4 4
5 import java.io.Serializable; 5 import java.io.Serializable;
6 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
15 @Entity
16 @Table(name = "gauges")
7 public class Gauge 17 public class Gauge
8 implements Serializable 18 implements Serializable
9 { 19 {
10 private Integer id; 20 private Integer id;
11 private String name; 21 private String name;
12 private River river; 22 private River river;
13 private BigDecimal station; 23 private BigDecimal station;
14 private BigDecimal aeo; 24 private BigDecimal aeo;
15 private BigDecimal datum; 25 private BigDecimal datum;
16 private Range range; 26 private Range range;
17 27
18 public Gauge() { 28 public Gauge() {
19 } 29 }
20 30
31 @Id
32 @SequenceGenerator(
33 name = "SEQUENCE_GAUGES_ID_SEQ",
34 sequenceName = "GAUGES_ID_SEQ",
35 allocationSize = 1)
36 @GeneratedValue(
37 strategy = GenerationType.SEQUENCE,
38 generator = "SEQUENCE_GAUGES_ID_SEQ")
39 @Column(name = "id")
40 public Integer getId() {
41 return id;
42 }
43
21 public void setId(Integer id) { 44 public void setId(Integer id) {
22 this.id = id; 45 this.id = id;
23 }
24
25 public Integer getId() {
26 return id;
27 } 46 }
28 47
29 public void setName(String name) { 48 public void setName(String name) {
30 this.name = name; 49 this.name = name;
31 } 50 }

http://dive4elements.wald.intevation.org