comparison flys-backend/src/main/java/de/intevation/flys/model/Position.java @ 2877:f0a67bc0e777 2.7

merged flys-backend/2.7
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:31 +0200
parents ecf90018563b
children
comparison
equal deleted inserted replaced
2793:6310b1582f2d 2877:f0a67bc0e777
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4
5 import javax.persistence.Entity;
6 import javax.persistence.Id;
7 import javax.persistence.Table;
8 import javax.persistence.GeneratedValue;
9 import javax.persistence.Column;
10 import javax.persistence.SequenceGenerator;
11 import javax.persistence.OneToMany;
12 import javax.persistence.JoinColumn;
13 import javax.persistence.GenerationType;
14
15 import java.util.List;
16
17 @Entity
18 @Table(name = "positions")
19 public class Position
20 implements Serializable
21 {
22 private Integer id;
23
24 private String value;
25
26 private List<Annotation> annotations;
27
28 public Position() {
29 }
30
31 public Position(String value) {
32 this.value = value;
33 }
34
35 @Id
36 @SequenceGenerator(
37 name = "SEQUENCE_POSITIONS_ID_SEQ",
38 sequenceName = "POSITIONS_ID_SEQ",
39 allocationSize = 1)
40 @GeneratedValue(
41 strategy = GenerationType.SEQUENCE,
42 generator = "SEQUENCE_POSITIONS_ID_SEQ")
43 @Column(name = "id")
44 public Integer getId() {
45 return id;
46 }
47
48 public void setId(Integer id) {
49 this.id = id;
50 }
51
52 @Column(name = "value")
53 public String getValue() {
54 return value;
55 }
56
57 public void setValue(String value) {
58 this.value = value;
59 }
60
61 @OneToMany
62 @JoinColumn(name="position_id")
63 public List<Annotation> getAnnotations() {
64 return annotations;
65 }
66
67 public void setAnnotations(List<Annotation> annotations) {
68 this.annotations = annotations;
69 }
70 }
71 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org