Subversion Repositories WebE

Rev

Rev 33 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33 Rev 34
Line 10... Line 10...
10
import javax.persistence.JoinColumn;
10
import javax.persistence.JoinColumn;
11
import javax.persistence.ManyToOne;
11
import javax.persistence.ManyToOne;
12
import javax.persistence.OneToOne;
12
import javax.persistence.OneToOne;
13
import javax.persistence.PrimaryKeyJoinColumn;
13
import javax.persistence.PrimaryKeyJoinColumn;
14
import javax.persistence.Table;
14
import javax.persistence.Table;
-
 
15
import javax.persistence.Transient;
15
import javax.persistence.UniqueConstraint;
16
import javax.persistence.UniqueConstraint;
-
 
17
16
import org.hibernate.annotations.GenericGenerator;
18
import org.hibernate.annotations.GenericGenerator;
17
import org.hibernate.annotations.Parameter;
19
import org.hibernate.annotations.Parameter;
18
20
19
/**
21
/**
20
 * Relationship generated by hbm2java
22
 * Relationship generated by hbm2java
21
 */
23
 */
22
@Entity
24
@Entity
23
@Table(name = "relationship", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = {
25
@Table(name = "relationship", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = {
24
                "term_from", "term_to", "type" }))
26
    "term_from", "term_to", "type_id" }))
25
public class Relationship implements java.io.Serializable {
27
public class Relationship implements java.io.Serializable
26
28
{
27
        private int objectId;
29
  private int objectId;
-
 
30
28
        private Term termByTermTo;
31
  @Transient
29
        private ObjectEntity object;
32
  private ObjectEntity object;
-
 
33
30
        private RelationshipType relationshipType;
34
  private Term termFrom;
31
        private Term termByTermFrom;
35
  private Term termTo;
-
 
36
  private RelationshipType relationshipType;
32
37
33
        public Relationship() {
38
  public Relationship()
-
 
39
  {
34
        }
40
  }
35
41
36
        public Relationship(Term termByTermTo, ObjectEntity object,
42
  public Relationship(Term termByTermTo, ObjectEntity object,
37
                        RelationshipType relationshipType, Term termByTermFrom) {
43
      RelationshipType relationshipType, Term termByTermFrom)
-
 
44
  {
38
                this.termByTermTo = termByTermTo;
45
    this.termTo = termByTermTo;
39
                this.object = object;
46
    this.object = object;
40
                this.relationshipType = relationshipType;
47
    this.relationshipType = relationshipType;
41
                this.termByTermFrom = termByTermFrom;
48
    this.termFrom = termByTermFrom;
42
        }
49
  }
43
50
44
        @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
51
  @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
45
        @Id
52
  @Id
46
        @GeneratedValue(generator = "generator")
53
  @GeneratedValue(generator = "generator")
47
        @Column(name = "object_id", unique = true, nullable = false)
54
  @Column(name = "object_id", unique = true, nullable = false)
48
        public int getObjectId() {
55
  public int getObjectId()
-
 
56
  {
49
                return this.objectId;
57
    return this.objectId;
50
        }
58
  }
51
59
52
        public void setObjectId(int objectId) {
60
  public void setObjectId(int objectId)
-
 
61
  {
53
                this.objectId = objectId;
62
    this.objectId = objectId;
54
        }
63
  }
55
64
56
        @ManyToOne(fetch = FetchType.LAZY)
65
  @ManyToOne(fetch = FetchType.LAZY)
57
        @JoinColumn(name = "term_to", nullable = false)
66
  @JoinColumn(name = "term_to", nullable = false)
58
        public Term getTermByTermTo() {
67
  public Term getTermTo()
-
 
68
  {
59
                return this.termByTermTo;
69
    return this.termTo;
60
        }
70
  }
61
71
62
        public void setTermByTermTo(Term termByTermTo) {
72
  public void setTermTo(Term termByTermTo)
-
 
73
  {
63
                this.termByTermTo = termByTermTo;
74
    this.termTo = termByTermTo;
64
        }
75
  }
65
76
66
        @OneToOne(fetch = FetchType.LAZY)
77
  @OneToOne(fetch = FetchType.LAZY)
67
        @PrimaryKeyJoinColumn
78
  @PrimaryKeyJoinColumn
68
        public ObjectEntity getObject() {
79
  public ObjectEntity getObject()
-
 
80
  {
69
                return this.object;
81
    return this.object;
70
        }
82
  }
71
83
72
        public void setObject(ObjectEntity object) {
84
  public void setObject(ObjectEntity object)
-
 
85
  {
73
                this.object = object;
86
    this.object = object;
74
        }
87
  }
75
88
76
        @ManyToOne(fetch = FetchType.LAZY)
89
  @ManyToOne(fetch = FetchType.LAZY)
77
        @JoinColumn(name = "type", nullable = false)
90
  @JoinColumn(name = "type_id", nullable = false)
78
        public RelationshipType getRelationshipType() {
91
  public RelationshipType getRelationshipType()
-
 
92
  {
79
                return this.relationshipType;
93
    return this.relationshipType;
80
        }
94
  }
81
95
82
        public void setRelationshipType(RelationshipType relationshipType) {
96
  public void setRelationshipType(RelationshipType relationshipType)
-
 
97
  {
83
                this.relationshipType = relationshipType;
98
    this.relationshipType = relationshipType;
84
        }
99
  }
85
100
86
        @ManyToOne(fetch = FetchType.LAZY)
101
  @ManyToOne(fetch = FetchType.LAZY)
87
        @JoinColumn(name = "term_from", nullable = false)
102
  @JoinColumn(name = "term_from", nullable = false)
88
        public Term getTermByTermFrom() {
103
  public Term getTermFrom()
-
 
104
  {
89
                return this.termByTermFrom;
105
    return this.termFrom;
90
        }
106
  }
91
107
92
        public void setTermByTermFrom(Term termByTermFrom) {
108
  public void setTermFrom(Term termByTermFrom)
-
 
109
  {
93
                this.termByTermFrom = termByTermFrom;
110
    this.termFrom = termByTermFrom;
94
        }
111
  }
95
112
96
}
113
}