Mercurial > dive4elements > river
changeset 6313:38a3f021fd97
Backend: Add Hibernate model for official lines.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 18:01:42 +0200 |
parents | ac99cade71dd |
children | fe8e3d5c25d4 |
files | backend/src/main/java/org/dive4elements/river/backend/FLYSCredentials.java backend/src/main/java/org/dive4elements/river/model/OfficialLine.java |
diffstat | 2 files changed, 81 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/backend/FLYSCredentials.java Wed Jun 12 17:46:56 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/backend/FLYSCredentials.java Wed Jun 12 18:01:42 2013 +0200 @@ -84,6 +84,7 @@ import org.dive4elements.river.model.WstColumnQRange; import org.dive4elements.river.model.WstColumnValue; import org.dive4elements.river.model.WstQRange; +import org.dive4elements.river.model.OfficialLine; public class FLYSCredentials extends Credentials @@ -205,7 +206,8 @@ WstColumnQRange.class, WstColumnValue.class, Wst.class, - WstQRange.class + WstQRange.class, + OfficialLine.class }; public FLYSCredentials() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/src/main/java/org/dive4elements/river/model/OfficialLine.java Wed Jun 12 18:01:42 2013 +0200 @@ -0,0 +1,78 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +@Table(name = "official_lines") +public class OfficialLine +implements Serializable +{ + + private Integer id; + private WstColumn wstColumn; + private NamedMainValue namedMainValue; + + public OfficialLine() { + } + + public OfficialLine(WstColumn wstColumn, NamedMainValue namedMainValue) { + this.wstColumn = wstColumn; + this.namedMainValue = namedMainValue; + } + + @Id + @SequenceGenerator( + name = "SEQUENCE_OFFICIAL_LINES_ID_SEQ", + sequenceName = "OFFICIAL_LINES_ID_SEQ_ID_SEQ", + allocationSize = 1) + @GeneratedValue( + strategy = GenerationType.SEQUENCE, + generator = "SEQUENCE_OFFICIAL_LINES_ID_SEQ") + @Column(name = "id") + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @OneToOne + @JoinColumn(name = "wst_column_id" ) + public WstColumn getWstColumn() { + return wstColumn; + } + + public void setWstColumn(WstColumn wstColumn) { + this.wstColumn = wstColumn; + } + + @OneToOne + @JoinColumn(name = "named_main_value_id" ) + public NamedMainValue getNamedMainValue() { + return namedMainValue; + } + + public void setNamedMainValue(NamedMainValue namedMainValue) { + this.namedMainValue = namedMainValue; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :