ingo@2346: package de.intevation.flys.model; ingo@2346: ingo@2346: import java.io.Serializable; ingo@2346: ingo@2346: import javax.persistence.Column; ingo@2346: import javax.persistence.Entity; ingo@2346: import javax.persistence.GeneratedValue; ingo@2346: import javax.persistence.GenerationType; ingo@2346: import javax.persistence.Id; ingo@2346: import javax.persistence.SequenceGenerator; ingo@2346: import javax.persistence.Table; ingo@2346: ingo@2346: ingo@2346: @Entity ingo@2346: @Table(name = "units") ingo@2346: public class Unit ingo@2346: implements Serializable ingo@2346: { ingo@2346: protected Integer id; ingo@2346: protected String name; ingo@2346: ingo@2346: ingo@2346: public Unit() { ingo@2346: } ingo@2346: ingo@2346: ingo@2346: public Unit(String name) { ingo@2346: this.name = name; ingo@2346: } ingo@2346: ingo@2346: ingo@2346: @Id ingo@2346: @SequenceGenerator( ingo@2346: name = "SEQUENCE_UNITS_ID_SEQ", ingo@2346: sequenceName = "UNITS_ID_SEQ", ingo@2346: allocationSize = 1) ingo@2346: @GeneratedValue( ingo@2346: strategy = GenerationType.SEQUENCE, ingo@2346: generator = "SEQUENCE_UNITS_ID_SEQ") ingo@2346: @Column(name = "id") ingo@2346: public Integer getId() { ingo@2346: return id; ingo@2346: } ingo@2346: ingo@2346: public void setId(Integer id) { ingo@2346: this.id = id; ingo@2346: } ingo@2346: ingo@2346: ingo@2346: @Column(name = "name") ingo@2346: public String getName() { ingo@2346: return name; ingo@2346: } ingo@2346: ingo@2346: ingo@2346: public void setName(String name) { ingo@2346: this.name = name; ingo@2346: } ingo@2346: } ingo@2346: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :