sascha@1210: package de.intevation.flys.model; sascha@1210: sascha@1210: import java.io.Serializable; sascha@1210: sascha@1210: import java.util.List; sascha@1210: sascha@1210: import javax.persistence.Entity; sascha@1210: import javax.persistence.Id; sascha@1210: import javax.persistence.Table; sascha@1210: import javax.persistence.GeneratedValue; sascha@1210: import javax.persistence.Column; sascha@1210: import javax.persistence.SequenceGenerator; sascha@1210: import javax.persistence.GenerationType; sascha@1210: import javax.persistence.OneToOne; sascha@1210: import javax.persistence.OneToMany; sascha@1210: import javax.persistence.OrderBy; sascha@1210: import javax.persistence.JoinColumn; sascha@1210: sascha@1210: @Entity sascha@1210: @Table(name = "hyks") sascha@1210: public class HYK sascha@1210: implements Serializable sascha@1210: { sascha@1210: private Integer id; sascha@1210: private River river; sascha@1210: private String description; sascha@1210: sascha@1210: private List entries; sascha@1210: sascha@1210: public HYK() { sascha@1210: } sascha@1210: sascha@1217: public HYK(River river, String description) { sascha@1210: this.river = river; sascha@1210: this.description = description; sascha@1210: } sascha@1210: sascha@1210: @Id sascha@1210: @SequenceGenerator( sascha@1210: name = "SEQUENCE_HYKS_ID_SEQ", sascha@1210: sequenceName = "HYKS_ID_SEQ", sascha@1210: allocationSize = 1) sascha@1210: @GeneratedValue( sascha@1210: strategy = GenerationType.SEQUENCE, sascha@1210: generator = "SEQUENCE_HYKS_ID_SEQ") sascha@1210: @Column(name = "id") sascha@1210: public Integer getId() { sascha@1210: return id; sascha@1210: } sascha@1210: sascha@1210: public void setId(Integer id) { sascha@1210: this.id = id; sascha@1210: } sascha@1210: sascha@1210: @OneToOne sascha@1210: @JoinColumn(name = "river_id") sascha@1210: public River getRiver() { sascha@1210: return river; sascha@1210: } sascha@1210: sascha@1210: public void setRiver(River river) { sascha@1210: this.river = river; sascha@1210: } sascha@1210: sascha@1224: @Column(name = "description") sascha@1210: public String getDescription() { sascha@1210: return description; sascha@1210: } sascha@1210: sascha@1210: public void setDescription(String description) { sascha@1210: this.description = description; sascha@1210: } sascha@1210: sascha@1210: @OneToMany sascha@1210: @OrderBy("km") sascha@1210: @JoinColumn(name="hyk_id") sascha@1210: public List getEntries() { sascha@1210: return entries; sascha@1210: } sascha@1210: sascha@1210: public void setEntries(List entries) { sascha@1210: this.entries = entries; sascha@1210: } sascha@1210: } sascha@1210: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :