ingo@2842: package de.intevation.flys.model; ingo@2842: ingo@2842: import java.io.Serializable; ingo@2842: import java.util.ArrayList; ingo@2842: import java.util.List; ingo@2842: ingo@2842: import javax.persistence.Entity; ingo@2842: import javax.persistence.Id; ingo@2842: import javax.persistence.Table; ingo@2842: import javax.persistence.GeneratedValue; ingo@2842: import javax.persistence.Column; ingo@2842: import javax.persistence.SequenceGenerator; ingo@2842: import javax.persistence.GenerationType; ingo@2842: import javax.persistence.JoinColumn; ingo@2842: import javax.persistence.OneToOne; ingo@2842: import javax.persistence.OneToMany; ingo@2842: ingo@2842: import org.apache.log4j.Logger; ingo@2842: ingo@2842: ingo@2842: ingo@2842: ingo@2842: @Entity ingo@2842: @Table(name = "waterlevel_q_range") ingo@2842: public class WaterlevelQRange ingo@2842: implements Serializable ingo@2842: { ingo@2842: private static Logger logger = Logger.getLogger(WaterlevelQRange.class); ingo@2842: ingo@2842: private Integer id; ingo@2842: ingo@2842: private Waterlevel waterlevel; ingo@2842: ingo@2842: private Double q; ingo@2842: ingo@2842: private List values; ingo@2842: ingo@2842: ingo@2842: public WaterlevelQRange() { ingo@2842: this.values = new ArrayList(); ingo@2842: } ingo@2842: ingo@2842: public WaterlevelQRange(Waterlevel waterlevel, Double q) { ingo@2842: this(); ingo@2842: this.q = q; ingo@2842: this.waterlevel = waterlevel; ingo@2842: } ingo@2842: ingo@2842: ingo@2842: @Id ingo@2842: @SequenceGenerator( ingo@2842: name = "SEQUENCE_WATERLEVEL_Q_RANGE_ID_SEQ", ingo@2842: sequenceName = "WATERLEVEL_Q_RANGES_ID_SEQ", ingo@2842: allocationSize = 1) ingo@2842: @GeneratedValue( ingo@2842: strategy = GenerationType.SEQUENCE, ingo@2842: generator = "SEQUENCE_WATERLEVEL_Q_RANGE_ID_SEQ") ingo@2842: @Column(name = "id") ingo@2842: public Integer getId() { ingo@2842: return id; ingo@2842: } ingo@2842: ingo@2842: public void setId(Integer id) { ingo@2842: this.id = id; ingo@2842: } ingo@2842: ingo@2842: @OneToOne ingo@2842: @JoinColumn(name = "waterlevel_id" ) ingo@2842: public Waterlevel getWaterlevel() { ingo@2842: return waterlevel; ingo@2842: } ingo@2842: ingo@2842: public void setWaterlevel(Waterlevel waterlevel) { ingo@2842: this.waterlevel = waterlevel; ingo@2842: } ingo@2842: ingo@2842: @Column(name = "q") ingo@2842: public Double getQ() { ingo@2842: return q; ingo@2842: } ingo@2842: ingo@2842: public void setQ(Double q) { ingo@2842: this.q = q; ingo@2842: } ingo@2842: ingo@2842: @OneToMany ingo@2842: @Column(name = "waterlevel_q_range_id") ingo@2842: public List getValues() { ingo@2842: return values; ingo@2842: } ingo@2842: ingo@2842: public void setValues(List values) { ingo@2842: this.values = values; ingo@2842: } ingo@2842: ingo@2842: public void addValue(WaterlevelValue value) { ingo@2842: values.add(value); ingo@2842: } ingo@2842: } ingo@2842: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :