sascha@167: package de.intevation.flys.model; sascha@167: sascha@167: import java.io.Serializable; sascha@167: sascha@171: import javax.persistence.Entity; sascha@171: import javax.persistence.Id; sascha@171: import javax.persistence.Table; sascha@171: import javax.persistence.GeneratedValue; sascha@171: import javax.persistence.Column; sascha@171: import javax.persistence.SequenceGenerator; sascha@171: import javax.persistence.GenerationType; sascha@174: import javax.persistence.OneToOne; sascha@174: import javax.persistence.JoinColumn; sascha@171: sascha@171: @Entity sascha@171: @Table(name = "annotations") sascha@167: public class Annotation sascha@167: implements Serializable sascha@167: { sascha@763: private Integer id; sascha@763: private Range range; sascha@763: private Attribute attribute; sascha@763: private Position position; sascha@763: private Edge edge; sascha@763: private AnnotationType type; sascha@167: sascha@167: public Annotation() { sascha@167: } sascha@167: sascha@758: public Annotation( sascha@763: Range range, sascha@763: Attribute attribute, sascha@763: Position position, sascha@763: Edge edge, sascha@763: AnnotationType type sascha@758: ) { sascha@188: this.range = range; sascha@188: this.attribute = attribute; sascha@188: this.position = position; sascha@758: this.edge = edge; sascha@763: this.type = type; sascha@188: } sascha@188: sascha@171: @Id sascha@171: @SequenceGenerator( sascha@171: name = "SEQUENCE_ANNOTATIONS_ID_SEQ", sascha@171: sequenceName = "ANNOTATIONS_ID_SEQ", sascha@171: allocationSize = 1) sascha@171: @GeneratedValue( sascha@171: strategy = GenerationType.SEQUENCE, sascha@171: generator = "SEQUENCE_ANNOTATIONS_ID_SEQ") sascha@171: @Column(name = "id") sascha@171: public Integer getId() { sascha@171: return id; sascha@171: } sascha@171: sascha@168: public void setId(Integer id) { sascha@167: this.id = id; sascha@167: } sascha@167: sascha@174: @OneToOne sascha@174: @JoinColumn(name = "range_id") sascha@174: public Range getRange() { sascha@174: return range; sascha@174: } sascha@174: sascha@167: public void setRange(Range range) { sascha@167: this.range = range; sascha@167: } sascha@167: sascha@174: @OneToOne sascha@174: @JoinColumn(name = "attribute_id") sascha@174: public Attribute getAttribute() { sascha@174: return attribute; sascha@167: } sascha@167: sascha@167: public void setAttribute(Attribute attribute) { sascha@167: this.attribute = attribute; sascha@167: } sascha@167: sascha@174: @OneToOne sascha@174: @JoinColumn(name = "position_id") sascha@174: public Position getPosition() { sascha@174: return position; sascha@167: } sascha@167: sascha@167: public void setPosition(Position position) { sascha@167: this.position = position; sascha@167: } sascha@758: sascha@758: @OneToOne sascha@758: @JoinColumn(name = "edge_id") sascha@758: public Edge getEdge() { sascha@758: return edge; sascha@758: } sascha@758: sascha@758: public void setEdge(Edge edge) { sascha@758: this.edge = edge; sascha@758: } sascha@763: sascha@763: @OneToOne sascha@763: @JoinColumn(name = "type_id") sascha@763: public AnnotationType getType() { sascha@763: return type; sascha@763: } sascha@763: sascha@763: public void setType(AnnotationType type) { sascha@763: this.type = type; sascha@763: } sascha@167: } sascha@167: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :