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