ingo@3321: package de.intevation.flys.model; ingo@3321: ingo@3321: import java.io.Serializable; ingo@3321: ingo@3321: import java.util.List; ingo@3321: ingo@3321: import javax.persistence.Entity; ingo@3321: import javax.persistence.Id; ingo@3321: import javax.persistence.Table; ingo@3321: import javax.persistence.GeneratedValue; ingo@3321: import javax.persistence.Column; ingo@3321: import javax.persistence.SequenceGenerator; ingo@3321: import javax.persistence.OneToMany; ingo@3329: import javax.persistence.OneToOne; ingo@3321: import javax.persistence.JoinColumn; ingo@3321: import javax.persistence.GenerationType; ingo@3321: ingo@3321: ingo@3321: @Entity ingo@3321: @Table(name = "sq_relation") ingo@3321: public class SQRelation implements Serializable { ingo@3321: ingo@3321: private Integer id; ingo@3321: ingo@3329: private River river; ingo@3329: ingo@3321: private TimeInterval timeInterval; ingo@3321: ingo@3321: private String description; ingo@3321: ingo@3321: private List values; ingo@3321: ingo@3321: ingo@3329: protected SQRelation() { ingo@3329: } ingo@3329: ingo@3329: ingo@3329: public SQRelation(River river, TimeInterval timeInterval, String desc) { ingo@3329: this.river = river; ingo@3329: this.timeInterval = timeInterval; ingo@3329: this.description = desc; ingo@3329: } ingo@3329: ingo@3329: ingo@3321: @Id ingo@3321: @SequenceGenerator( ingo@3321: name = "SEQUENCE_SQ_ID_SEQ", ingo@3321: sequenceName = "SQ_RELATION_ID_SEQ", ingo@3321: allocationSize = 1) ingo@3321: @GeneratedValue( ingo@3321: strategy = GenerationType.SEQUENCE, ingo@3321: generator = "SEQUENCE_SQ_ID_SEQ") ingo@3321: @Column(name = "id") ingo@3321: public Integer getId() { ingo@3321: return id; ingo@3321: } ingo@3321: ingo@3321: public void setId(Integer id) { ingo@3321: this.id = id; ingo@3321: } ingo@3321: ingo@3321: ingo@3329: @OneToOne ingo@3329: @JoinColumn(name = "river_id") ingo@3329: public River getRiver() { ingo@3329: return river; ingo@3329: } ingo@3329: ingo@3329: public void setRiver(River river) { ingo@3329: this.river = river; ingo@3329: } ingo@3329: ingo@3329: ingo@3321: @Column(name = "description") ingo@3321: public String getDescription() { ingo@3321: return description; ingo@3321: } ingo@3321: ingo@3321: public void setDescription(String description) { ingo@3321: this.description = description; ingo@3321: } ingo@3321: ingo@3321: ingo@3329: @OneToOne ingo@3329: @JoinColumn(name = "time_interval_id") ingo@3321: public TimeInterval getTimeInterval() { ingo@3321: return timeInterval; ingo@3321: } ingo@3321: ingo@3321: public void setTimeInterval(TimeInterval timeInterval) { ingo@3321: this.timeInterval = timeInterval; ingo@3321: } ingo@3321: ingo@3321: ingo@3321: @OneToMany ingo@3321: @JoinColumn(name = "sq_relation_id") ingo@3321: public List getValues() { ingo@3321: return values; ingo@3321: } ingo@3321: ingo@3321: public void setValues(List values) { ingo@3321: this.values = values; ingo@3321: } ingo@3321: } ingo@3321: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :