ingo@2830: package de.intevation.flys.model; ingo@2830: ingo@2830: import java.io.Serializable; ingo@2830: import java.util.List; ingo@2830: ingo@2830: import javax.persistence.Entity; ingo@2830: import javax.persistence.Id; ingo@2830: import javax.persistence.Table; ingo@2830: import javax.persistence.GeneratedValue; ingo@2830: import javax.persistence.Column; ingo@2830: import javax.persistence.SequenceGenerator; ingo@2830: import javax.persistence.GenerationType; ingo@2830: import javax.persistence.JoinColumn; ingo@2830: import javax.persistence.OneToOne; ingo@2830: import javax.persistence.OneToMany; ingo@2830: ingo@2830: import org.apache.log4j.Logger; ingo@2830: ingo@2830: ingo@2830: @Entity ingo@2830: @Table(name = "flow_velocity_measurements") ingo@2830: public class FlowVelocityMeasurement ingo@2830: implements Serializable ingo@2830: { ingo@2830: private static Logger logger = ingo@2830: Logger.getLogger(FlowVelocityMeasurement.class); ingo@2830: ingo@2830: ingo@2830: private Integer id; ingo@2830: ingo@2830: private River river; ingo@2830: ingo@2830: private String description; ingo@2830: ingo@2830: private List values; ingo@2830: ingo@2830: ingo@2830: public FlowVelocityMeasurement() { ingo@2830: } ingo@2830: ingo@2830: ingo@2830: public FlowVelocityMeasurement(River river, String description) { ingo@2830: this.river = river; ingo@2830: this.description = description; ingo@2830: } ingo@2830: ingo@2830: @Id ingo@2830: @SequenceGenerator( ingo@2830: name = "SEQUENCE_FV_MEASURE_ID_SEQ", ingo@2830: sequenceName = "FV_MEASURE_ID_SEQ", ingo@2830: allocationSize = 1) ingo@2830: @GeneratedValue( ingo@2830: strategy = GenerationType.SEQUENCE, ingo@2830: generator = "SEQUENCE_FV_MEASURE_ID_SEQ") ingo@2830: @Column(name = "id") ingo@2830: public Integer getId() { ingo@2830: return id; ingo@2830: } ingo@2830: ingo@2830: public void setId(Integer id) { ingo@2830: this.id = id; ingo@2830: } ingo@2830: ingo@2830: @OneToOne ingo@2830: @JoinColumn(name = "river_id" ) ingo@2830: public River getRiver() { ingo@2830: return river; ingo@2830: } ingo@2830: ingo@2830: public void setRiver(River river) { ingo@2830: this.river = river; ingo@2830: } ingo@2830: ingo@2830: @Column(name = "description") ingo@2830: public String getDescription() { ingo@2830: return description; ingo@2830: } ingo@2830: ingo@2830: public void setDescription(String description) { ingo@2830: this.description = description; ingo@2830: } ingo@2830: ingo@2830: @OneToMany ingo@2830: @JoinColumn(name = "measurements_id") ingo@2830: public List getValues() { ingo@2830: return values; ingo@2830: } ingo@2830: ingo@2830: public void setValues(List values) { ingo@2830: this.values = values; ingo@2830: } ingo@2830: ingo@2830: public void addValue(FlowVelocityMeasurementValue value) { ingo@2830: this.values.add(value); ingo@2830: } ingo@2830: } ingo@2830: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :