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