view backend/src/main/java/org/dive4elements/river/model/sinfo/ChannelValue.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 189cc8ededbd
line wrap: on
line source
/* 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 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;


/**
 * Hibernate binding for the DB table channel_values
 *
 * @author Matthias Schäfer
 *
 */
@Entity
@Table(name = "channel_values")
public class ChannelValue implements Serializable {

    /***** FIELDS *****/

    private static final long serialVersionUID = -3793243094875530557L;

    private Integer id;

    private Channel channel;

    private Double station;

    private Double width;

    private Double depth;


    /***** CONSTRUCTORS *****/

    public ChannelValue() {
    }

    public ChannelValue(final Channel channel, final Double station, final Double width, final Double depth) {
        this.channel = channel;
        this.station = station;
        this.width = width;
        this.depth = depth;
    }

    /**
     * Parameter constructor with primitive parameter types
     */
    public ChannelValue(final Channel channel, final double km, final double width, final double depth) {
        this(channel, Double.valueOf(km), Double.valueOf(width), Double.valueOf(depth));
    }


    /***** METHODS *****/

    @Id
    @SequenceGenerator(name = "SEQUENCE_CHANNEL_VALUE_ID_SEQ", sequenceName = "CHANNEL_VALUES_ID_SEQ", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_CHANNEL_VALUE_ID_SEQ")
    @Column(name = "id")
    public Integer getId() {
        return this.id;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    @OneToOne
    @JoinColumn(name = "channel_id")
    public Channel getChannel() {
        return this.channel;
    }

    public void setChannel(final Channel channel) {
        this.channel = channel;
    }

    @Column(name = "station")
    public Double getStation() {
        return this.station;
    }

    public void setStation(final Double station) {
        this.station = station;
    }

    @Column(name = "width")
    public Double getWidth() {
        return this.width;
    }

    public void setWidth(final Double width) {
        this.width = width;
    }

    @Column(name = "depth")
    public Double getDepth() {
        return this.depth;
    }

    public void setDepth(final Double depth) {
        this.depth = depth;
    }
}

http://dive4elements.wald.intevation.org