Mercurial > dive4elements > river
changeset 1193:1e3979e07b9e
Added hibernate point3d model
flys-backend/trunk@2288 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 06 Jul 2011 10:46:02 +0000 |
parents | 5f8444df19e4 |
children | 491892931761 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java flys-backend/src/main/java/de/intevation/flys/model/Point3d.java |
diffstat | 3 files changed, 86 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Wed Jul 06 10:23:45 2011 +0000 +++ b/flys-backend/ChangeLog Wed Jul 06 10:46:02 2011 +0000 @@ -1,3 +1,9 @@ +2011-07-06 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/model/Point3d.java: New. point3d model + * src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java: + Registered point3d model. + 2011-07-06 Sascha L. Teichmann <sascha.teichmann@intevation.de> * doc/schema/postgresql.sql: Add relations for cross sections.
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java Wed Jul 06 10:23:45 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java Wed Jul 06 10:46:02 2011 +0000 @@ -19,6 +19,7 @@ import de.intevation.flys.model.MainValueType; import de.intevation.flys.model.NamedMainValue; import de.intevation.flys.model.MainValue; +import de.intevation.flys.model.Point3d; import de.intevation.flys.model.Position; import de.intevation.flys.model.Range; import de.intevation.flys.model.River; @@ -124,6 +125,7 @@ cfg.addAnnotatedClass(MainValueType.class); cfg.addAnnotatedClass(NamedMainValue.class); cfg.addAnnotatedClass(MainValue.class); + cfg.addAnnotatedClass(Point3d.class); cfg.addAnnotatedClass(Position.class); cfg.addAnnotatedClass(Range.class); cfg.addAnnotatedClass(River.class);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Point3d.java Wed Jul 06 10:46:02 2011 +0000 @@ -0,0 +1,78 @@ +package de.intevation.flys.model; + +import java.io.Serializable; + +import java.math.BigDecimal; + +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; + +@Entity +@Table(name = "points3d") +public class Point3d +implements Serializable +{ + private Integer id; + private BigDecimal x; + private BigDecimal y; + private BigDecimal z; + + public Point3d() { + } + + public Point3d(BigDecimal x, BigDecimal y, BigDecimal z) { + this.x = x; + this.y = y; + this.z = z; + } + + @Id + @SequenceGenerator( + name = "SEQUENCE_POINTS3D_ID_SEQ", + sequenceName = "POINTS3D_ID_SEQ", + allocationSize = 1) + @GeneratedValue( + strategy = GenerationType.SEQUENCE, + generator = "SEQUENCE_POINTS3D_ID_SEQ") + @Column(name = "id") + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @Column(name = "x") + public BigDecimal getX() { + return x; + } + + public void setX(BigDecimal x) { + this.x = x; + } + + @Column(name = "y") + public BigDecimal getY() { + return y; + } + + public void setY(BigDecimal y) { + this.y = y; + } + + @Column(name = "z") + public BigDecimal getZ() { + return z; + } + + public void setZ(BigDecimal z) { + this.z = z; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :