Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/ElevationModel.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 | f283212966e8 |
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.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.JoinColumn; | |
13 import javax.persistence.OneToOne; | |
14 | |
15 import org.apache.log4j.Logger; | |
16 | |
17 | |
18 @Entity | |
19 @Table(name = "elevation_model") | |
20 public class ElevationModel | |
21 implements Serializable | |
22 { | |
23 private static Logger logger = Logger.getLogger(ElevationModel.class); | |
24 | |
25 protected Integer id; | |
26 | |
27 protected String name; | |
28 | |
29 protected Unit unit; | |
30 | |
31 | |
32 public ElevationModel() { | |
33 } | |
34 | |
35 | |
36 public ElevationModel(String name, Unit unit) { | |
37 this.name = name; | |
38 this.unit = unit; | |
39 } | |
40 | |
41 | |
42 @Id | |
43 @SequenceGenerator( | |
44 name = "SEQUENCE_ELEVATION_MODE_ID_SEQ", | |
45 sequenceName = "ELEVATION_MODEL_SEQ", | |
46 allocationSize = 1) | |
47 @GeneratedValue( | |
48 strategy = GenerationType.SEQUENCE, | |
49 generator = "SEQUENCE_ELEVATION_MODE_ID_SEQ") | |
50 @Column(name = "id") | |
51 public Integer getId() { | |
52 return id; | |
53 } | |
54 | |
55 public void setId(Integer id) { | |
56 this.id = id; | |
57 } | |
58 | |
59 @Column(name = "name") | |
60 public String getName() { | |
61 return name; | |
62 } | |
63 | |
64 public void setName(String name) { | |
65 this.name = name; | |
66 } | |
67 | |
68 @OneToOne | |
69 @JoinColumn(name = "unit_id") | |
70 public Unit getUnit() { | |
71 return unit; | |
72 } | |
73 | |
74 public void setUnit(Unit unit) { | |
75 this.unit = unit; | |
76 } | |
77 } | |
78 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |