ingo@2837: package de.intevation.flys.model; ingo@2837: ingo@2837: import java.io.Serializable; ingo@2837: import java.util.ArrayList; ingo@2837: import java.util.List; ingo@2837: ingo@2837: import javax.persistence.Entity; ingo@2837: import javax.persistence.Id; ingo@2837: import javax.persistence.Table; ingo@2837: import javax.persistence.GeneratedValue; ingo@2837: import javax.persistence.Column; ingo@2837: import javax.persistence.SequenceGenerator; ingo@2837: import javax.persistence.GenerationType; ingo@2837: import javax.persistence.JoinColumn; ingo@2837: import javax.persistence.OneToOne; ingo@2837: ingo@2837: import org.apache.log4j.Logger; ingo@2837: ingo@2837: ingo@2837: @Entity ingo@2837: @Table(name = "sediment_yield") ingo@2837: public class SedimentYield ingo@2837: implements Serializable ingo@2837: { ingo@2837: private static Logger logger = Logger.getLogger(SedimentYield.class); ingo@2837: ingo@2837: private Integer id; ingo@2837: ingo@2837: private River river; ingo@2837: ingo@2837: private GrainFraction grainFraction; ingo@2837: ingo@2837: private Unit unit; ingo@2837: ingo@2837: private TimeInterval timeInterval; ingo@2837: ingo@2840: private String description; ingo@2840: ingo@2837: private List values; ingo@2837: ingo@2837: ingo@2837: public SedimentYield() { ingo@2837: this.values = new ArrayList(); ingo@2837: } ingo@2837: ingo@2837: public SedimentYield(River river, Unit unit, TimeInterval timeInterval) { ingo@2837: this(); ingo@2837: ingo@2837: this.river = river; ingo@2837: this.unit = unit; ingo@2837: this.timeInterval = timeInterval; ingo@2837: } ingo@2837: ingo@2837: ingo@2837: public SedimentYield( ingo@2837: River river, ingo@2837: Unit unit, ingo@2837: TimeInterval timeInterval, ingo@2837: GrainFraction grainFraction ingo@2837: ) { ingo@2837: this(river, unit, timeInterval); ingo@2837: ingo@2837: this.grainFraction = grainFraction; ingo@2837: } ingo@2837: ingo@2840: ingo@2840: public SedimentYield( ingo@2840: River river, ingo@2840: Unit unit, ingo@2840: TimeInterval timeInterval, ingo@2840: GrainFraction grainFraction, ingo@2840: String description ingo@2840: ) { ingo@2840: this(river, unit, timeInterval, grainFraction); ingo@2840: ingo@2840: this.description = description; ingo@2840: } ingo@2840: ingo@2837: @Id ingo@2837: @SequenceGenerator( ingo@2837: name = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ", ingo@2837: sequenceName = "SEDIMENT_YIELD_ID_SEQ", ingo@2837: allocationSize = 1) ingo@2837: @GeneratedValue( ingo@2837: strategy = GenerationType.SEQUENCE, ingo@2837: generator = "SEQUENCE_SEDIMENT_YIELD_ID_SEQ") ingo@2837: @Column(name = "id") ingo@2837: public Integer getId() { ingo@2837: return id; ingo@2837: } ingo@2837: ingo@2837: public void setId(Integer id) { ingo@2837: this.id = id; ingo@2837: } ingo@2837: ingo@2837: @OneToOne ingo@2837: @JoinColumn(name = "river_id") ingo@2837: public River getRiver() { ingo@2837: return river; ingo@2837: } ingo@2837: ingo@2837: public void setRiver(River river) { ingo@2837: this.river = river; ingo@2837: } ingo@2837: ingo@2837: @OneToOne ingo@2837: @JoinColumn(name="grain_fraction_id") ingo@2837: public GrainFraction getGrainFraction() { ingo@2837: return grainFraction; ingo@2837: } ingo@2837: ingo@2837: public void setGrainFraction(GrainFraction grainFraction) { ingo@2837: this.grainFraction = grainFraction; ingo@2837: } ingo@2837: ingo@2837: @OneToOne ingo@2837: @JoinColumn(name = "unit_id") ingo@2837: public Unit getUnit() { ingo@2837: return unit; ingo@2837: } ingo@2837: ingo@2837: public void setUnit(Unit unit) { ingo@2837: this.unit = unit; ingo@2837: } ingo@2837: ingo@2837: @OneToOne ingo@2837: @JoinColumn(name = "time_interval_id") ingo@2837: public TimeInterval getTimeInterval() { ingo@2837: return timeInterval; ingo@2837: } ingo@2837: ingo@2837: public void setTimeInterval(TimeInterval timeInterval) { ingo@2837: this.timeInterval = timeInterval; ingo@2837: } ingo@2840: ingo@2840: @Column(name = "description") ingo@2840: public String getDescription() { ingo@2840: return description; ingo@2840: } ingo@2840: ingo@2840: public void setDescription(String description) { ingo@2840: this.description = description; ingo@2840: } ingo@2837: } ingo@2837: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :