view backend/src/main/java/org/dive4elements/river/model/sinfo/CollisionValue.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 623b51bf03d7
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 java.util.Date;

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 collision_values
 *
 * @author Matthias Schäfer
 *
 */
@Entity
@Table(name = "collision_values")
public class CollisionValue implements Serializable {

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

    private static final long serialVersionUID = -1157324854470346513L;

    private Integer id;

    private Collision collision;

    private Double station;

    private CollisionType collisionType;

    private Date eventDate;

    private String gaugeName;

    private Double gaugeW;


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

    public CollisionValue() {
    }

    public CollisionValue(final Collision collision, final Double station, final CollisionType collisionType, final Date eventDate, final String gaugeName,
            final Double gaugeW) {
        this.collision = collision;
        this.station = station;
        this.collisionType = collisionType;
        this.eventDate = eventDate;
        this.gaugeName = gaugeName;
        this.gaugeW = gaugeW;
    }

    /**
     * Constructor with primitive parameter types
     */
    public CollisionValue(final Collision collision, final double km, final CollisionType collisionType, final Date eventDate, final String gaugeName,
            final double gaugeW) {
        this(collision, Double.valueOf(km), collisionType, eventDate, gaugeName, Double.valueOf(gaugeW));
    }


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

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

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

    @OneToOne
    @JoinColumn(name = "collision_id")
    public Collision getCollision() {
        return this.collision;
    }

    public void setCollision(final Collision collision) {
        this.collision = collision;
    }

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

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

    @OneToOne
    @JoinColumn(name = "collision_type_id")
    public CollisionType getCollisionType() {
        return this.collisionType;
    }

    public void setCollisionType(final CollisionType collisionType) {
        this.collisionType = collisionType;
    }

    @Column(name = "event_date")
    public Date getEventDate() {
        return this.eventDate;
    }

    public void setEventDate(final Date eventDate) {
        this.eventDate = eventDate;
    }

    @Column(name = "gauge_name")
    public String getGaugeName() {
        return this.gaugeName;
    }

    public void setGaugeName(final String gaugeName) {
        this.gaugeName = gaugeName;
    }

    @Column(name = "gauge_w")
    public Double getGaugeW() {
        return this.gaugeW;
    }

    public void setGaugeW(final Double gaugeW) {
        this.gaugeW = gaugeW;
    }
}

http://dive4elements.wald.intevation.org