Subversion Repositories WebE

Rev

Rev 33 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21 moos 1
package ch.ffhs.webE.domain;
2
 
3
// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.FetchType;
8
import javax.persistence.GeneratedValue;
9
import javax.persistence.Id;
10
import javax.persistence.JoinColumn;
11
import javax.persistence.ManyToOne;
12
import javax.persistence.OneToOne;
13
import javax.persistence.PrimaryKeyJoinColumn;
14
import javax.persistence.Table;
15
import javax.persistence.UniqueConstraint;
16
import org.hibernate.annotations.GenericGenerator;
17
import org.hibernate.annotations.Parameter;
18
 
19
/**
20
 * Relationship generated by hbm2java
21
 */
22
@Entity
23
@Table(name = "relationship", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = {
24
                "term_from", "term_to", "type" }))
25
public class Relationship implements java.io.Serializable {
26
 
27
        private int objectId;
28
        private Term termByTermTo;
29
        private Object object;
30
        private RelationshipType relationshipType;
31
        private Term termByTermFrom;
32
 
33
        public Relationship() {
34
        }
35
 
36
        public Relationship(Term termByTermTo, Object object,
37
                        RelationshipType relationshipType, Term termByTermFrom) {
38
                this.termByTermTo = termByTermTo;
39
                this.object = object;
40
                this.relationshipType = relationshipType;
41
                this.termByTermFrom = termByTermFrom;
42
        }
43
 
44
        @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
45
        @Id
46
        @GeneratedValue(generator = "generator")
47
        @Column(name = "object_id", unique = true, nullable = false)
48
        public int getObjectId() {
49
                return this.objectId;
50
        }
51
 
52
        public void setObjectId(int objectId) {
53
                this.objectId = objectId;
54
        }
55
 
56
        @ManyToOne(fetch = FetchType.LAZY)
57
        @JoinColumn(name = "term_to", nullable = false)
58
        public Term getTermByTermTo() {
59
                return this.termByTermTo;
60
        }
61
 
62
        public void setTermByTermTo(Term termByTermTo) {
63
                this.termByTermTo = termByTermTo;
64
        }
65
 
66
        @OneToOne(fetch = FetchType.LAZY)
67
        @PrimaryKeyJoinColumn
68
        public Object getObject() {
69
                return this.object;
70
        }
71
 
72
        public void setObject(Object object) {
73
                this.object = object;
74
        }
75
 
76
        @ManyToOne(fetch = FetchType.LAZY)
77
        @JoinColumn(name = "type", nullable = false)
78
        public RelationshipType getRelationshipType() {
79
                return this.relationshipType;
80
        }
81
 
82
        public void setRelationshipType(RelationshipType relationshipType) {
83
                this.relationshipType = relationshipType;
84
        }
85
 
86
        @ManyToOne(fetch = FetchType.LAZY)
87
        @JoinColumn(name = "term_from", nullable = false)
88
        public Term getTermByTermFrom() {
89
                return this.termByTermFrom;
90
        }
91
 
92
        public void setTermByTermFrom(Term termByTermFrom) {
93
                this.termByTermFrom = termByTermFrom;
94
        }
95
 
96
}