Mercurial > dive4elements > river
diff backend/src/main/java/org/dive4elements/river/model/sinfo/TkhColumn.java @ 8971:50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author | mschaefer |
---|---|
date | Tue, 03 Apr 2018 10:18:30 +0200 |
parents | |
children | 6e5ff436febe |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/src/main/java/org/dive4elements/river/model/sinfo/TkhColumn.java Tue Apr 03 10:18:30 2018 +0200 @@ -0,0 +1,106 @@ +/* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt + * + * 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.sinfo; + +import java.io.Serializable; +import java.util.List; + +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.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +/** + * Hibernate binding for the DB table tkh_column + * + * @author Matthias Schäfer + * + */ +@Entity +@Table(name = "tkh_column") +public class TkhColumn implements Serializable { + + /***** FIELDS *****/ + + private static final long serialVersionUID = -6567598780584866314L; + + private Integer id; + + private Tkh parent; + + private String name; + + private List<TkhValue> values; + + + /***** CONSTRUCTORS *****/ + + public TkhColumn() { + } + + public TkhColumn(final Tkh parent, final String name) { + this.parent = parent; + this.name = name; + } + + /***** METHODS *****/ + + @Id + @SequenceGenerator(name = "SEQUENCE_TKH_COLUMN_ID_SEQ", sequenceName = "TKH_COLUMN_ID_SEQ", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_TKH_COLUMN_ID_SEQ") + @Column(name = "id") + public Integer getId() { + return this.id; + } + + public void setId(final Integer id) { + this.id = id; + } + + @OneToOne + @JoinColumn(name = "tkh_id") + public Tkh getTkh() { + return this.parent; + } + + public void setTkh(final Tkh tkh) { + this.parent = tkh; + } + + @Column(name = "name") + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + @OneToMany + @JoinColumn(name = "tkh_column_id") + public List<TkhValue> getValues() { + return this.values; + } + + public void setValues(final List<TkhValue> values) { + this.values = values; + } + + public void addValue(final TkhValue value) { + this.values.add(value); + } +}