teichmann@8026: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@8026: * Software engineering by Intevation GmbH teichmann@8026: * teichmann@8026: * This file is Free Software under the GNU AGPL (>=v3) teichmann@8026: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@8026: * documentation coming with Dive4Elements River for details. teichmann@8026: */ teichmann@8026: package org.dive4elements.river.model; teichmann@8026: teichmann@8026: import java.io.Serializable; teichmann@8026: import java.util.List; teichmann@8026: teichmann@8026: import javax.persistence.Column; teichmann@8026: import javax.persistence.Entity; teichmann@8026: import javax.persistence.GeneratedValue; teichmann@8026: import javax.persistence.GenerationType; teichmann@8026: import javax.persistence.Id; teichmann@8026: import javax.persistence.JoinColumn; teichmann@8026: import javax.persistence.OneToMany; teichmann@8026: import javax.persistence.OneToOne; teichmann@8026: import javax.persistence.SequenceGenerator; teichmann@8026: import javax.persistence.Table; teichmann@8026: teichmann@8026: @Entity teichmann@8026: @Table(name = "sediment_load") teichmann@8026: public class SedimentLoad teichmann@8026: implements Serializable teichmann@8026: { teichmann@8026: private Integer id; teichmann@8026: teichmann@8026: private GrainFraction grainFraction; teichmann@8026: teichmann@8026: private TimeInterval timeInterval; teichmann@8026: teichmann@8026: private TimeInterval sqTimeInterval; teichmann@8026: teichmann@8026: private String description; teichmann@8026: teichmann@8026: private Integer kind; teichmann@8026: teichmann@8026: private List values; teichmann@8026: teichmann@8026: public SedimentLoad() { teichmann@8026: } teichmann@8026: teichmann@8028: public SedimentLoad( teichmann@8028: GrainFraction grainFraction, teichmann@8028: TimeInterval timeInterval, teichmann@8028: TimeInterval sqTimeInterval, teichmann@8028: String description, teichmann@8028: Integer kind teichmann@8028: ) { teichmann@8028: this.grainFraction = grainFraction; teichmann@8028: this.timeInterval = timeInterval; teichmann@8028: this.sqTimeInterval = sqTimeInterval; teichmann@8028: this.description = description; teichmann@8028: this.kind = kind; teichmann@8028: } teichmann@8028: teichmann@8026: @Id teichmann@8026: @SequenceGenerator( teichmann@8026: name = "SEQUENCE_SEDIMENT_LOAD_ID_SEQ", teichmann@8026: sequenceName = "SEDIMENT_LOAD_ID_SEQ", teichmann@8026: allocationSize = 1) teichmann@8026: @GeneratedValue( teichmann@8026: strategy = GenerationType.SEQUENCE, teichmann@8026: generator = "SEQUENCE_SEDIMENT_LOAD_ID_SEQ") teichmann@8026: @Column(name = "id") teichmann@8026: public Integer getId() { teichmann@8026: return id; teichmann@8026: } teichmann@8026: teichmann@8026: public void setId(Integer id) { teichmann@8026: this.id = id; teichmann@8026: } teichmann@8026: teichmann@8026: @OneToOne teichmann@8026: @JoinColumn(name="grain_fraction_id") teichmann@8026: public GrainFraction getGrainFraction() { teichmann@8026: return grainFraction; teichmann@8026: } teichmann@8026: teichmann@8026: public void setGrainFraction(GrainFraction grainFraction) { teichmann@8026: this.grainFraction = grainFraction; teichmann@8026: } teichmann@8026: teichmann@8026: @OneToOne teichmann@8026: @JoinColumn(name = "time_interval_id") teichmann@8026: public TimeInterval getTimeInterval() { teichmann@8026: return timeInterval; teichmann@8026: } teichmann@8026: teichmann@8026: public void setTimeInterval(TimeInterval timeInterval) { teichmann@8026: this.timeInterval = timeInterval; teichmann@8026: } teichmann@8026: teichmann@8026: @OneToOne teichmann@8026: @JoinColumn(name = "sq_time_interval_id") tom@8059: public TimeInterval getSqTimeInterval() { teichmann@8026: return sqTimeInterval; teichmann@8026: } teichmann@8026: tom@8059: public void setSqTimeInterval(TimeInterval sqTimeInterval) { teichmann@8026: this.sqTimeInterval = sqTimeInterval; teichmann@8026: } teichmann@8026: teichmann@8026: @Column(name = "description") teichmann@8026: public String getDescription() { teichmann@8026: return description; teichmann@8026: } teichmann@8026: teichmann@8026: public void setDescription(String description) { teichmann@8026: this.description = description; teichmann@8026: } teichmann@8026: teichmann@8026: /** kind == 0: "normal", kind == 1: "official epoch". */ teichmann@8026: @Column(name = "kind") teichmann@8026: public Integer getKind() { teichmann@8026: return kind; teichmann@8026: } teichmann@8026: teichmann@8026: public void setKind(Integer newKind) { teichmann@8026: this.kind = newKind; teichmann@8026: } teichmann@8026: teichmann@8026: @OneToMany teichmann@8026: @JoinColumn(name="sediment_load_id") teichmann@8026: public List getSedimentLoadValues() { teichmann@8026: return values; teichmann@8026: } teichmann@8026: teichmann@8026: public void setSedimentLoadValues(List values) { teichmann@8026: this.values = values; teichmann@8026: } teichmann@8026: } teichmann@8026: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :