Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/CrossSectionLine.java Thu Jul 07 15:59:24 2011 +0000 @@ -0,0 +1,79 @@ +package de.intevation.flys.model; + +import java.io.Serializable; + +import java.math.BigDecimal; + +import java.util.List; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.GeneratedValue; +import javax.persistence.Column; +import javax.persistence.SequenceGenerator; +import javax.persistence.GenerationType; +import javax.persistence.OneToOne; +import javax.persistence.OneToMany; +import javax.persistence.JoinColumn; + +@Entity +@Table(name = "cross_section_lines") +public class CrossSectionLine +implements Serializable +{ + private Integer id; + private BigDecimal km; + private List<CrossSectionPoint> points; + private CrossSection crossSection; + + public CrossSectionLine() { + } + + @Id + @SequenceGenerator( + name = "SEQUENCE_CROSS_SECTION_LINES_ID_SEQ", + sequenceName = "CROSS_SECTION_LINES_ID_SEQ", + allocationSize = 1) + @GeneratedValue( + strategy = GenerationType.SEQUENCE, + generator = "SEQUENCE_CROSS_SECTION_LINES_ID_SEQ") + @Column(name = "id") + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @Column(name = "km") + public BigDecimal getKm() { + return km; + } + + public void setKm(BigDecimal km) { + this.km = km; + } + + @OneToOne + @JoinColumn(name = "cross_section_id") + public CrossSection getCrossSection() { + return crossSection; + } + + public void setCrossSection(CrossSection CrossSection) { + this.crossSection = crossSection; + } + + @OneToMany + @JoinColumn(name="cross_section_line_id") + public List<CrossSectionPoint> getPoints() { + return points; + } + + public void setPoints(List<CrossSectionPoint> points) { + this.points = points; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :