ingo@2809: package de.intevation.flys.model; ingo@2809: ingo@2809: import java.io.Serializable; ingo@2809: ingo@2809: import javax.persistence.Entity; ingo@2809: import javax.persistence.Id; ingo@2809: import javax.persistence.Table; ingo@2809: import javax.persistence.GeneratedValue; ingo@2809: import javax.persistence.Column; ingo@2809: import javax.persistence.SequenceGenerator; ingo@2809: import javax.persistence.GenerationType; ingo@2809: import javax.persistence.JoinColumn; ingo@2809: import javax.persistence.OneToOne; ingo@2809: ingo@2809: import org.apache.log4j.Logger; ingo@2809: ingo@2809: ingo@2809: @Entity ingo@2809: @Table(name = "elevation_model") ingo@2809: public class ElevationModel ingo@2809: implements Serializable ingo@2809: { ingo@2809: private static Logger logger = Logger.getLogger(ElevationModel.class); ingo@2809: ingo@2809: protected Integer id; ingo@2809: ingo@2809: protected String name; ingo@2809: ingo@2809: protected Unit unit; ingo@2809: ingo@2809: ingo@2809: public ElevationModel() { ingo@2809: } ingo@2809: ingo@2809: ingo@2809: public ElevationModel(String name, Unit unit) { ingo@2809: this.name = name; ingo@2809: this.unit = unit; ingo@2809: } ingo@2809: ingo@2809: ingo@2809: @Id ingo@2809: @SequenceGenerator( ingo@2809: name = "SEQUENCE_ELEVATION_MODE_ID_SEQ", ingo@2809: sequenceName = "ELEVATION_MODEL_SEQ", ingo@2809: allocationSize = 1) ingo@2809: @GeneratedValue( ingo@2809: strategy = GenerationType.SEQUENCE, ingo@2809: generator = "SEQUENCE_ELEVATION_MODE_ID_SEQ") ingo@2809: @Column(name = "id") ingo@2809: public Integer getId() { ingo@2809: return id; ingo@2809: } ingo@2809: ingo@2809: public void setId(Integer id) { ingo@2809: this.id = id; ingo@2809: } ingo@2809: ingo@2809: @Column(name = "name") ingo@2809: public String getName() { ingo@2809: return name; ingo@2809: } ingo@2809: ingo@2809: public void setName(String name) { ingo@2809: this.name = name; ingo@2809: } ingo@2809: ingo@2809: @OneToOne ingo@2809: @JoinColumn(name = "unit_id") ingo@2809: public Unit getUnit() { ingo@2809: return unit; ingo@2809: } ingo@2809: ingo@2809: public void setUnit(Unit unit) { ingo@2809: this.unit = unit; ingo@2809: } ingo@2809: } ingo@2809: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :