view flys-backend/src/main/java/de/intevation/flys/model/BedHeightEpoch.java @ 2846:c1c6c9190636

Improved the db schema to store MINFO specific waterlevel differences. flys-backend/trunk@4289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 24 Apr 2012 13:04:30 +0000
parents 04eeb45df27b
children bcfdaa3a5bfc
line wrap: on
line source
package de.intevation.flys.model;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.Column;
import javax.persistence.SequenceGenerator;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.OneToMany;


@Entity
@Table(name = "bed_height_epoch")
public class BedHeightEpoch implements Serializable {

    private Integer id;

    private River river;

    private TimeInterval timeInterval;

    private ElevationModel curElevationModel;
    private ElevationModel oldElevationModel;

    private Range range;

    private String evaluationBy;
    private String description;

    private List<BedHeightEpochValue> values;


    public BedHeightEpoch() {
    }


    public BedHeightEpoch(
        River          river,
        TimeInterval   timeInterval,
        Range          range,
        ElevationModel curElevationModel,
        ElevationModel oldElevationModel,
        String         evaluationBy,
        String         description
    ) {
        this.river             = river;
        this.timeInterval      = timeInterval;
        this.range             = range;
        this.curElevationModel = curElevationModel;
        this.oldElevationModel = oldElevationModel;
        this.evaluationBy      = evaluationBy;
        this.description       = description;
        this.values            = new ArrayList<BedHeightEpochValue>();
    }


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

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

    @OneToOne
    @JoinColumn(name = "river_id" )
    public River getRiver() {
        return river;
    }

    public void setRiver(River river) {
        this.river = river;
    }

    @OneToOne
    @JoinColumn(name = "time_interval_id")
    public TimeInterval getTimeInterval() {
        return timeInterval;
    }

    public void setTimeInterval(TimeInterval timeInterval) {
        this.timeInterval = timeInterval;
    }

    @OneToOne
    @JoinColumn(name = "cur_elevation_model_id")
    public ElevationModel getCurElevationModel() {
        return curElevationModel;
    }

    public void setCurElevationModel(ElevationModel curElevationModel) {
        this.curElevationModel = curElevationModel;
    }

    @OneToOne
    @JoinColumn(name = "old_elevation_model_id")
    public ElevationModel getOldElevationModel() {
        return oldElevationModel;
    }

    public void setOldElevationModel(ElevationModel oldElevationModel) {
        this.oldElevationModel = oldElevationModel;
    }

    @OneToOne
    @JoinColumn(name = "range_id")
    public Range getRange() {
        return range;
    }

    public void setRange(Range range) {
        this.range = range;
    }

    @Column(name = "evaluation_by")
    public String getEvaluationBy() {
        return evaluationBy;
    }

    public void setEvaluationBy(String evaluationBy) {
        this.evaluationBy = evaluationBy;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @OneToMany
    @JoinColumn(name = "bed_height_epoch_id")
    public List<BedHeightEpochValue> getValues() {
        return values;
    }

    public void setValues(List<BedHeightEpochValue> values) {
        this.values = values;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org