Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Range.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.io.Serializable; | 3 import java.io.Serializable; |
4 | 4 |
5 import java.math.BigDecimal; | 5 import java.math.BigDecimal; |
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 = "ranges") | |
7 public class Range | 17 public class Range |
8 implements Serializable | 18 implements Serializable |
9 { | 19 { |
10 private Integer id; | 20 private Integer id; |
11 private BigDecimal a; | 21 private BigDecimal a; |
12 private BigDecimal b; | 22 private BigDecimal b; |
13 | 23 |
14 private River river; | 24 private River river; |
15 | 25 |
16 public Range() { | 26 public Range() { |
17 } | 27 } |
18 | 28 |
29 @Id | |
30 @SequenceGenerator( | |
31 name = "SEQUENCE_RANGES_ID_SEQ", | |
32 sequenceName = "RANGES_ID_SEQ", | |
33 allocationSize = 1) | |
34 @GeneratedValue( | |
35 strategy = GenerationType.SEQUENCE, | |
36 generator = "SEQUENCE_RANGES_ID_SEQ") | |
37 @Column(name = "id") | |
38 public Integer getId() { | |
39 return id; | |
40 } | |
41 | |
19 public void setId(Integer id) { | 42 public void setId(Integer id) { |
20 this.id = id; | 43 this.id = id; |
21 } | |
22 | |
23 public Integer getId() { | |
24 return id; | |
25 } | 44 } |
26 | 45 |
27 public void setA(BigDecimal a) { | 46 public void setA(BigDecimal a) { |
28 this.a = a; | 47 this.a = a; |
29 } | 48 } |