comparison flys-backend/src/main/java/de/intevation/flys/model/TimeInterval.java @ 3820:8a75cf0841b1 pre2.7-2012-03-16

merged flys-backend/pre2.7-2012-03-16
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:59 +0200
parents 8ea09ec7f0c8
children
comparison
equal deleted inserted replaced
3818:dc18457b1cef 3820:8a75cf0841b1
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4
5 import java.util.Date;
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")
17 public class TimeInterval
18 implements Serializable
19 {
20 private Integer id;
21 private Date startTime;
22 private Date stopTime;
23
24 public TimeInterval() {
25 }
26
27 public TimeInterval(Date startTime, Date stopTime) {
28 this.startTime = startTime;
29 this.stopTime = stopTime;
30 }
31
32 @Id
33 @SequenceGenerator(
34 name = "SEQUENCE_TIME_INTERVALS_ID_SEQ",
35 sequenceName = "TIME_INTERVALS_ID_SEQ",
36 allocationSize = 1)
37 @GeneratedValue(
38 strategy = GenerationType.SEQUENCE,
39 generator = "SEQUENCE_TIME_INTERVALS_ID_SEQ")
40 @Column(name = "id")
41 public Integer getId() {
42 return id;
43 }
44
45 public void setId(Integer id) {
46 this.id = id;
47 }
48
49 @Column(name = "start_time") // FIXME: type mapping needed?
50 public Date getStartTime() {
51 return startTime;
52 }
53
54 public void setStartTime(Date startTime) {
55 this.startTime = startTime;
56 }
57
58 @Column(name = "stop_time") // FIXME: type mapping needed?
59 public Date getStopTime() {
60 return stopTime;
61 }
62
63 public void setStopTime(Date stopTime) {
64 this.stopTime = stopTime;
65 }
66 }
67 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org