Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Position.java @ 174:249390dd24e7
Added foreign key constraint annotations to model classes.
flys-backend/trunk@1473 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 15 Mar 2011 14:49:56 +0000 |
parents | 605320b7df94 |
children | ecf90018563b |
comparison
equal
deleted
inserted
replaced
173:8e2f2ddc507f | 174:249390dd24e7 |
---|---|
6 import javax.persistence.Id; | 6 import javax.persistence.Id; |
7 import javax.persistence.Table; | 7 import javax.persistence.Table; |
8 import javax.persistence.GeneratedValue; | 8 import javax.persistence.GeneratedValue; |
9 import javax.persistence.Column; | 9 import javax.persistence.Column; |
10 import javax.persistence.SequenceGenerator; | 10 import javax.persistence.SequenceGenerator; |
11 import javax.persistence.OneToMany; | |
12 import javax.persistence.JoinColumn; | |
11 import javax.persistence.GenerationType; | 13 import javax.persistence.GenerationType; |
14 | |
15 import java.util.List; | |
12 | 16 |
13 @Entity | 17 @Entity |
14 @Table(name = "positions") | 18 @Table(name = "positions") |
15 public class Position | 19 public class Position |
16 implements Serializable | 20 implements Serializable |
17 { | 21 { |
18 private Integer id; | 22 private Integer id; |
19 | 23 |
20 private String value; | 24 private String value; |
25 | |
26 private List<Annotation> annotations; | |
21 | 27 |
22 public Position() { | 28 public Position() { |
23 } | 29 } |
24 | 30 |
25 @Id | 31 @Id |
45 } | 51 } |
46 | 52 |
47 public void setValue(String value) { | 53 public void setValue(String value) { |
48 this.value = value; | 54 this.value = value; |
49 } | 55 } |
56 | |
57 @OneToMany | |
58 @JoinColumn(name="position_id") | |
59 public List<Annotation> getAnnotations() { | |
60 return annotations; | |
61 } | |
62 | |
63 public void setAnnotations(List<Annotation> annotations) { | |
64 this.annotations = annotations; | |
65 } | |
50 } | 66 } |
51 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 67 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |