Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Annotation.java @ 508:a9c7f6ec3a5a 2.3.1
merged flys-backend/2.3.1
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:12 +0200 |
parents | 003ac16812dd |
children | bf16268629d9 |
comparison
equal
deleted
inserted
replaced
462:ebf049a1eb53 | 508:a9c7f6ec3a5a |
---|---|
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.GenerationType; | |
12 import javax.persistence.OneToOne; | |
13 import javax.persistence.JoinColumn; | |
14 | |
15 @Entity | |
16 @Table(name = "annotations") | |
17 public class Annotation | |
18 implements Serializable | |
19 { | |
20 private Integer id; | |
21 private Range range; | |
22 private Attribute attribute; | |
23 private Position position; | |
24 | |
25 public Annotation() { | |
26 } | |
27 | |
28 public Annotation(Range range, Attribute attribute, Position position) { | |
29 this.range = range; | |
30 this.attribute = attribute; | |
31 this.position = position; | |
32 } | |
33 | |
34 @Id | |
35 @SequenceGenerator( | |
36 name = "SEQUENCE_ANNOTATIONS_ID_SEQ", | |
37 sequenceName = "ANNOTATIONS_ID_SEQ", | |
38 allocationSize = 1) | |
39 @GeneratedValue( | |
40 strategy = GenerationType.SEQUENCE, | |
41 generator = "SEQUENCE_ANNOTATIONS_ID_SEQ") | |
42 @Column(name = "id") | |
43 public Integer getId() { | |
44 return id; | |
45 } | |
46 | |
47 public void setId(Integer id) { | |
48 this.id = id; | |
49 } | |
50 | |
51 @OneToOne | |
52 @JoinColumn(name = "range_id") | |
53 public Range getRange() { | |
54 return range; | |
55 } | |
56 | |
57 public void setRange(Range range) { | |
58 this.range = range; | |
59 } | |
60 | |
61 @OneToOne | |
62 @JoinColumn(name = "attribute_id") | |
63 public Attribute getAttribute() { | |
64 return attribute; | |
65 } | |
66 | |
67 public void setAttribute(Attribute attribute) { | |
68 this.attribute = attribute; | |
69 } | |
70 | |
71 @OneToOne | |
72 @JoinColumn(name = "position_id") | |
73 public Position getPosition() { | |
74 return position; | |
75 } | |
76 | |
77 public void setPosition(Position position) { | |
78 this.position = position; | |
79 } | |
80 } | |
81 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |