Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/SQRelation.java @ 3321:a2a33eff93aa
Improved minfo db schema and added model classes for s/q relation.
flys-backend/trunk@4622 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 07 Jun 2012 09:52:44 +0000 |
parents | |
children | cc8fc6b29649 |
comparison
equal
deleted
inserted
replaced
3320:8f905390c10d | 3321:a2a33eff93aa |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import java.util.List; | |
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.OneToMany; | |
14 import javax.persistence.JoinColumn; | |
15 import javax.persistence.GenerationType; | |
16 | |
17 | |
18 @Entity | |
19 @Table(name = "sq_relation") | |
20 public class SQRelation implements Serializable { | |
21 | |
22 private Integer id; | |
23 | |
24 private TimeInterval timeInterval; | |
25 | |
26 private String description; | |
27 | |
28 private List<SQRelationValue> values; | |
29 | |
30 | |
31 @Id | |
32 @SequenceGenerator( | |
33 name = "SEQUENCE_SQ_ID_SEQ", | |
34 sequenceName = "SQ_RELATION_ID_SEQ", | |
35 allocationSize = 1) | |
36 @GeneratedValue( | |
37 strategy = GenerationType.SEQUENCE, | |
38 generator = "SEQUENCE_SQ_ID_SEQ") | |
39 @Column(name = "id") | |
40 public Integer getId() { | |
41 return id; | |
42 } | |
43 | |
44 public void setId(Integer id) { | |
45 this.id = id; | |
46 } | |
47 | |
48 | |
49 @Column(name = "description") | |
50 public String getDescription() { | |
51 return description; | |
52 } | |
53 | |
54 public void setDescription(String description) { | |
55 this.description = description; | |
56 } | |
57 | |
58 | |
59 @Column(name = "time_interval") | |
60 public TimeInterval getTimeInterval() { | |
61 return timeInterval; | |
62 } | |
63 | |
64 public void setTimeInterval(TimeInterval timeInterval) { | |
65 this.timeInterval = timeInterval; | |
66 } | |
67 | |
68 | |
69 @OneToMany | |
70 @JoinColumn(name = "sq_relation_id") | |
71 public List<SQRelationValue> getValues() { | |
72 return values; | |
73 } | |
74 | |
75 public void setValues(List<SQRelationValue> values) { | |
76 this.values = values; | |
77 } | |
78 } | |
79 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |