comparison flys-backend/src/main/java/de/intevation/flys/model/CrossSectionPoint.java @ 1194:491892931761

Added Hibernate models for cross-sections and their points. flys-backend/trunk@2290 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 06 Jul 2011 12:56:59 +0000
parents
children 2b4de678e29a
comparison
equal deleted inserted replaced
1193:1e3979e07b9e 1194:491892931761
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.OneToOne;
13 import javax.persistence.JoinColumn;
14
15 @Entity
16 @Table(name = "cross_section_points")
17 public class CrossSectionPoint
18 implements Serializable
19 {
20 private Integer id;
21 private CrossSection crossSection;
22 private Point3d point;
23 private Integer colPos;
24
25 public CrossSectionPoint() {
26 }
27
28 @Id
29 @SequenceGenerator(
30 name = "SEQUENCE_CROSS_SECTION_POINTS_ID_SEQ",
31 sequenceName = "CROSS_SECTION_POINTS_ID_SEQ",
32 allocationSize = 1)
33 @GeneratedValue(
34 strategy = GenerationType.SEQUENCE,
35 generator = "SEQUENCE_CROSS_SECTION_POINTS_ID_SEQ")
36 @Column(name = "id")
37 public Integer getId() {
38 return id;
39 }
40
41 public void setId(Integer id) {
42 this.id = id;
43 }
44
45 @OneToOne
46 @JoinColumn(name = "cross_section_id")
47 public CrossSection getCrossSection() {
48 return crossSection;
49 }
50
51 public void setCrossSection(CrossSection crossSection) {
52 this.crossSection = crossSection;
53 }
54
55 @OneToOne
56 @JoinColumn(name = "point3d_id")
57 public Point3d getPoint() {
58 return point;
59 }
60
61 public void setPoint(Point3d point) {
62 this.point = point;
63 }
64
65 @Column(name = "col_pos")
66 public Integer getColPos() {
67 return colPos;
68 }
69
70 public void setColPos(Integer colPos) {
71 this.colPos = colPos;
72 }
73 }
74 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org