Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Unit.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 | f834b411ca57 |
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.Column; | |
6 import javax.persistence.Entity; | |
7 import javax.persistence.GeneratedValue; | |
8 import javax.persistence.GenerationType; | |
9 import javax.persistence.Id; | |
10 import javax.persistence.SequenceGenerator; | |
11 import javax.persistence.Table; | |
12 | |
13 | |
14 @Entity | |
15 @Table(name = "units") | |
16 public class Unit | |
17 implements Serializable | |
18 { | |
19 protected Integer id; | |
20 protected String name; | |
21 | |
22 | |
23 public Unit() { | |
24 } | |
25 | |
26 | |
27 public Unit(String name) { | |
28 this.name = name; | |
29 } | |
30 | |
31 | |
32 @Id | |
33 @SequenceGenerator( | |
34 name = "SEQUENCE_UNITS_ID_SEQ", | |
35 sequenceName = "UNITS_ID_SEQ", | |
36 allocationSize = 1) | |
37 @GeneratedValue( | |
38 strategy = GenerationType.SEQUENCE, | |
39 generator = "SEQUENCE_UNITS_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 | |
50 @Column(name = "name") | |
51 public String getName() { | |
52 return name; | |
53 } | |
54 | |
55 | |
56 public void setName(String name) { | |
57 this.name = name; | |
58 } | |
59 } | |
60 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |