sascha@189: package de.intevation.flys.model; sascha@189: sascha@189: import java.io.Serializable; sascha@189: sascha@189: import javax.persistence.Entity; sascha@189: import javax.persistence.Id; sascha@189: import javax.persistence.Table; sascha@189: import javax.persistence.GeneratedValue; sascha@189: import javax.persistence.Column; sascha@189: import javax.persistence.SequenceGenerator; sascha@189: import javax.persistence.GenerationType; sascha@189: import javax.persistence.OneToOne; sascha@189: import javax.persistence.JoinColumn; sascha@189: sascha@189: @Entity sascha@189: @Table(name = "named_main_values") sascha@189: public class NamedMainValue sascha@189: implements Serializable sascha@189: { sascha@189: private Integer id; sascha@189: private String name; sascha@189: private MainValueType type; sascha@189: sascha@189: public NamedMainValue() { sascha@189: } sascha@189: sascha@195: public NamedMainValue(String name, MainValueType type) { sascha@195: this.name = name; sascha@195: this.type = type; sascha@195: } sascha@195: sascha@189: @Id sascha@189: @SequenceGenerator( sascha@189: name = "SEQUENCE_NAMED_MAIN_VALUES_ID_SEQ", sascha@189: sequenceName = "NAMED_MAIN_VALUES_ID_SEQ", sascha@189: allocationSize = 1) sascha@189: @GeneratedValue( sascha@189: strategy = GenerationType.SEQUENCE, sascha@189: generator = "SEQUENCE_NAMED_MAIN_VALUES_ID_SEQ") sascha@189: @Column(name = "id") sascha@189: public Integer getId() { sascha@189: return id; sascha@189: } sascha@189: sascha@189: public void setId(Integer id) { sascha@189: this.id = id; sascha@189: } sascha@189: sascha@189: @Column(name = "name") sascha@189: public String getName() { sascha@189: return name; sascha@189: } sascha@189: sascha@189: public void setName(String name) { sascha@189: this.name = name; sascha@189: } sascha@189: sascha@189: @OneToOne sascha@189: @JoinColumn(name = "type_id" ) sascha@189: public MainValueType getType() { sascha@189: return type; sascha@189: } sascha@189: sascha@189: public void setType(MainValueType type) { sascha@189: this.type = type; sascha@189: } sascha@189: } sascha@189: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :