comparison flys-backend/src/main/java/de/intevation/flys/model/CrossSectionLine.java @ 1203:3c01bef43a98

Querprofile: Added a table to map the points to a given km. flys-backend/trunk@2308 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 07 Jul 2011 15:59:24 +0000
parents
children 22858e7cca79
comparison
equal deleted inserted replaced
1202:44581b40b968 1203:3c01bef43a98
1 package de.intevation.flys.model;
2
3 import java.io.Serializable;
4
5 import java.math.BigDecimal;
6
7 import java.util.List;
8
9 import javax.persistence.Entity;
10 import javax.persistence.Id;
11 import javax.persistence.Table;
12 import javax.persistence.GeneratedValue;
13 import javax.persistence.Column;
14 import javax.persistence.SequenceGenerator;
15 import javax.persistence.GenerationType;
16 import javax.persistence.OneToOne;
17 import javax.persistence.OneToMany;
18 import javax.persistence.JoinColumn;
19
20 @Entity
21 @Table(name = "cross_section_lines")
22 public class CrossSectionLine
23 implements Serializable
24 {
25 private Integer id;
26 private BigDecimal km;
27 private List<CrossSectionPoint> points;
28 private CrossSection crossSection;
29
30 public CrossSectionLine() {
31 }
32
33 @Id
34 @SequenceGenerator(
35 name = "SEQUENCE_CROSS_SECTION_LINES_ID_SEQ",
36 sequenceName = "CROSS_SECTION_LINES_ID_SEQ",
37 allocationSize = 1)
38 @GeneratedValue(
39 strategy = GenerationType.SEQUENCE,
40 generator = "SEQUENCE_CROSS_SECTION_LINES_ID_SEQ")
41 @Column(name = "id")
42 public Integer getId() {
43 return id;
44 }
45
46 public void setId(Integer id) {
47 this.id = id;
48 }
49
50 @Column(name = "km")
51 public BigDecimal getKm() {
52 return km;
53 }
54
55 public void setKm(BigDecimal km) {
56 this.km = km;
57 }
58
59 @OneToOne
60 @JoinColumn(name = "cross_section_id")
61 public CrossSection getCrossSection() {
62 return crossSection;
63 }
64
65 public void setCrossSection(CrossSection CrossSection) {
66 this.crossSection = crossSection;
67 }
68
69 @OneToMany
70 @JoinColumn(name="cross_section_line_id")
71 public List<CrossSectionPoint> getPoints() {
72 return points;
73 }
74
75 public void setPoints(List<CrossSectionPoint> points) {
76 this.points = points;
77 }
78 }
79 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org