# HG changeset patch # User Sascha L. Teichmann # Date 1371052902 -7200 # Node ID 38a3f021fd977a8d58205d73cfed2546070c0770 # Parent ac99cade71dd0e233ca6b49bb086e7542d5dd8d1 Backend: Add Hibernate model for official lines. diff -r ac99cade71dd -r 38a3f021fd97 backend/src/main/java/org/dive4elements/river/backend/FLYSCredentials.java --- 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() { diff -r ac99cade71dd -r 38a3f021fd97 backend/src/main/java/org/dive4elements/river/model/OfficialLine.java --- /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 :