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