comparison flys-backend/src/main/java/de/intevation/flys/model/Attribute.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 605320b7df94
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 = "attributes")
5 public class Attribute 15 public class Attribute
6 implements Serializable 16 implements Serializable
7 { 17 {
8 private Integer id; 18 private Integer id;
9 19
10 private String value; 20 private String value;
11 21
12 public Attribute() { 22 public Attribute() {
13 } 23 }
14 24
25 @Id
26 @SequenceGenerator(
27 name = "SEQUENCE_ATTRIBUTES_ID_SEQ",
28 sequenceName = "ATTRIBUTES_ID_SEQ",
29 allocationSize = 1)
30 @GeneratedValue(
31 strategy = GenerationType.SEQUENCE,
32 generator = "SEQUENCE_ATTRIBUTES_ID_SEQ")
33 @Column(name = "id")
34 public Integer getId() {
35 return id;
36 }
37
15 public void setId(Integer id) { 38 public void setId(Integer id) {
16 this.id = id; 39 this.id = id;
17 }
18
19 public Integer getId() {
20 return id;
21 } 40 }
22 41
23 public void setValue(String value) { 42 public void setValue(String value) {
24 this.value = value; 43 this.value = value;
25 } 44 }

http://dive4elements.wald.intevation.org