Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/MorphologicalWidthValue.java @ 2818:25ed1f18fcc4
Improved the MIFNO DB schema for morphological width and added model classes.
flys-backend/trunk@4235 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 13 Apr 2012 12:33:26 +0000 |
parents | |
children | 0c2567626754 |
comparison
equal
deleted
inserted
replaced
2817:8979f2294af9 | 2818:25ed1f18fcc4 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 import java.math.BigDecimal; | |
5 | |
6 import javax.persistence.Entity; | |
7 import javax.persistence.Id; | |
8 import javax.persistence.Table; | |
9 import javax.persistence.GeneratedValue; | |
10 import javax.persistence.Column; | |
11 import javax.persistence.SequenceGenerator; | |
12 import javax.persistence.GenerationType; | |
13 import javax.persistence.JoinColumn; | |
14 import javax.persistence.OneToOne; | |
15 | |
16 | |
17 @Entity | |
18 @Table(name = "morphologic_width_values") | |
19 public class MorphologicalWidthValue implements Serializable { | |
20 | |
21 private Integer id; | |
22 | |
23 private MorphologicalWidth morphologicalWidth; | |
24 | |
25 private BigDecimal station; | |
26 private BigDecimal width; | |
27 | |
28 | |
29 public MorphologicalWidthValue() { | |
30 } | |
31 | |
32 | |
33 public MorphologicalWidthValue( | |
34 MorphologicalWidth morphologicalWidth, | |
35 BigDecimal station, | |
36 BigDecimal width | |
37 ) { | |
38 this.morphologicalWidth = morphologicalWidth; | |
39 this.station = station; | |
40 this.width = width; | |
41 } | |
42 | |
43 | |
44 @Id | |
45 @SequenceGenerator( | |
46 name = "SEQUENCE_MORPH_WIDTH_VALUES_ID_SEQ", | |
47 sequenceName = "MORPH_WIDTH_VALUES_ID_SEQ", | |
48 allocationSize = 1) | |
49 @GeneratedValue( | |
50 strategy = GenerationType.SEQUENCE, | |
51 generator = "SEQUENCE_MORPH_WIDTH_VALUES_ID_SEQ") | |
52 @Column(name = "id") | |
53 public Integer getId() { | |
54 return id; | |
55 } | |
56 | |
57 public void setId(Integer id) { | |
58 this.id = id; | |
59 } | |
60 | |
61 | |
62 @OneToOne | |
63 @JoinColumn(name = "morphologic_width_id") | |
64 public MorphologicalWidth getMorphologicalWidth() { | |
65 return morphologicalWidth; | |
66 } | |
67 | |
68 public void setMorphologicalWidth(MorphologicalWidth width) { | |
69 this.morphologicalWidth = width; | |
70 } | |
71 | |
72 @Column(name = "station") | |
73 public BigDecimal getStation() { | |
74 return station; | |
75 } | |
76 | |
77 public void setStation(BigDecimal station) { | |
78 this.station = station; | |
79 } | |
80 | |
81 @Column(name = "width") | |
82 public BigDecimal getWidth() { | |
83 return width; | |
84 } | |
85 | |
86 public void setWidth(BigDecimal width) { | |
87 this.width = width; | |
88 } | |
89 } | |
90 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |