Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/NamedMainValue.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 | 8d3533a03e10 |
children |
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 = "named_main_values") | |
17 public class NamedMainValue | |
18 implements Serializable | |
19 { | |
20 private Integer id; | |
21 private String name; | |
22 private MainValueType type; | |
23 | |
24 public NamedMainValue() { | |
25 } | |
26 | |
27 public NamedMainValue(String name, MainValueType type) { | |
28 this.name = name; | |
29 this.type = type; | |
30 } | |
31 | |
32 @Id | |
33 @SequenceGenerator( | |
34 name = "SEQUENCE_NAMED_MAIN_VALUES_ID_SEQ", | |
35 sequenceName = "NAMED_MAIN_VALUES_ID_SEQ", | |
36 allocationSize = 1) | |
37 @GeneratedValue( | |
38 strategy = GenerationType.SEQUENCE, | |
39 generator = "SEQUENCE_NAMED_MAIN_VALUES_ID_SEQ") | |
40 @Column(name = "id") | |
41 public Integer getId() { | |
42 return id; | |
43 } | |
44 | |
45 public void setId(Integer id) { | |
46 this.id = id; | |
47 } | |
48 | |
49 @Column(name = "name") | |
50 public String getName() { | |
51 return name; | |
52 } | |
53 | |
54 public void setName(String name) { | |
55 this.name = name; | |
56 } | |
57 | |
58 @OneToOne | |
59 @JoinColumn(name = "type_id" ) | |
60 public MainValueType getType() { | |
61 return type; | |
62 } | |
63 | |
64 public void setType(MainValueType type) { | |
65 this.type = type; | |
66 } | |
67 } | |
68 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |