comparison flys-backend/src/main/java/de/intevation/flys/model/Annotation.java @ 171:4a83e14f40f9

Added entity and id annotations. flys-backend/trunk@1463 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 14 Mar 2011 14:52:58 +0000
parents 86a1bd9cc50e
children 249390dd24e7
comparison
equal deleted inserted replaced
170:88c14d5d45be 171:4a83e14f40f9
1 package de.intevation.flys.model; 1 package de.intevation.flys.model;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
4 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
13 @Entity
14 @Table(name = "annotations")
5 public class Annotation 15 public class Annotation
6 implements Serializable 16 implements Serializable
7 { 17 {
8 private Integer id; 18 private Integer id;
9 private Range range; 19 private Range range;
11 private Position position; 21 private Position position;
12 22
13 public Annotation() { 23 public Annotation() {
14 } 24 }
15 25
26 @Id
27 @SequenceGenerator(
28 name = "SEQUENCE_ANNOTATIONS_ID_SEQ",
29 sequenceName = "ANNOTATIONS_ID_SEQ",
30 allocationSize = 1)
31 @GeneratedValue(
32 strategy = GenerationType.SEQUENCE,
33 generator = "SEQUENCE_ANNOTATIONS_ID_SEQ")
34 @Column(name = "id")
35 public Integer getId() {
36 return id;
37 }
38
16 public void setId(Integer id) { 39 public void setId(Integer id) {
17 this.id = id; 40 this.id = id;
18 }
19
20 public Integer getId() {
21 return id;
22 } 41 }
23 42
24 public void setRange(Range range) { 43 public void setRange(Range range) {
25 this.range = range; 44 this.range = range;
26 } 45 }

http://dive4elements.wald.intevation.org