Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/OfficialLine.java @ 6313:38a3f021fd97
Backend: Add Hibernate model for official lines.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 18:01:42 +0200 |
parents | |
children | 55a2f9e0d6ab efadb301549e |
comparison
equal
deleted
inserted
replaced
6312:ac99cade71dd | 6313:38a3f021fd97 |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.model; | |
10 | |
11 import java.io.Serializable; | |
12 | |
13 import javax.persistence.Column; | |
14 import javax.persistence.Entity; | |
15 import javax.persistence.GeneratedValue; | |
16 import javax.persistence.GenerationType; | |
17 import javax.persistence.Id; | |
18 import javax.persistence.JoinColumn; | |
19 import javax.persistence.OneToOne; | |
20 import javax.persistence.SequenceGenerator; | |
21 import javax.persistence.Table; | |
22 | |
23 @Entity | |
24 @Table(name = "official_lines") | |
25 public class OfficialLine | |
26 implements Serializable | |
27 { | |
28 | |
29 private Integer id; | |
30 private WstColumn wstColumn; | |
31 private NamedMainValue namedMainValue; | |
32 | |
33 public OfficialLine() { | |
34 } | |
35 | |
36 public OfficialLine(WstColumn wstColumn, NamedMainValue namedMainValue) { | |
37 this.wstColumn = wstColumn; | |
38 this.namedMainValue = namedMainValue; | |
39 } | |
40 | |
41 @Id | |
42 @SequenceGenerator( | |
43 name = "SEQUENCE_OFFICIAL_LINES_ID_SEQ", | |
44 sequenceName = "OFFICIAL_LINES_ID_SEQ_ID_SEQ", | |
45 allocationSize = 1) | |
46 @GeneratedValue( | |
47 strategy = GenerationType.SEQUENCE, | |
48 generator = "SEQUENCE_OFFICIAL_LINES_ID_SEQ") | |
49 @Column(name = "id") | |
50 public Integer getId() { | |
51 return id; | |
52 } | |
53 | |
54 public void setId(Integer id) { | |
55 this.id = id; | |
56 } | |
57 | |
58 @OneToOne | |
59 @JoinColumn(name = "wst_column_id" ) | |
60 public WstColumn getWstColumn() { | |
61 return wstColumn; | |
62 } | |
63 | |
64 public void setWstColumn(WstColumn wstColumn) { | |
65 this.wstColumn = wstColumn; | |
66 } | |
67 | |
68 @OneToOne | |
69 @JoinColumn(name = "named_main_value_id" ) | |
70 public NamedMainValue getNamedMainValue() { | |
71 return namedMainValue; | |
72 } | |
73 | |
74 public void setNamedMainValue(NamedMainValue namedMainValue) { | |
75 this.namedMainValue = namedMainValue; | |
76 } | |
77 } | |
78 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |