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 java.util.HashSet; |
||
6 | import java.util.Set; |
||
7 | import javax.persistence.Column; |
||
8 | import javax.persistence.Entity; |
||
9 | import javax.persistence.FetchType; |
||
10 | import javax.persistence.GeneratedValue; |
||
11 | import javax.persistence.Id; |
||
12 | import javax.persistence.OneToMany; |
||
13 | import javax.persistence.OneToOne; |
||
14 | import javax.persistence.PrimaryKeyJoinColumn; |
||
15 | import javax.persistence.Table; |
||
16 | import javax.persistence.UniqueConstraint; |
||
17 | import org.hibernate.annotations.GenericGenerator; |
||
18 | import org.hibernate.annotations.Parameter; |
||
19 | |||
20 | /** |
||
21 | * Term generated by hbm2java |
||
22 | */ |
||
23 | @Entity |
||
24 | @Table(name = "term", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name")) |
||
25 | public class Term implements java.io.Serializable { |
||
26 | |||
27 | private int objectId; |
||
28 | private Object object; |
||
29 | private String name; |
||
30 | private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>( |
||
31 | 0); |
||
32 | private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>( |
||
33 | 0); |
||
34 | |||
35 | public Term() { |
||
36 | } |
||
37 | |||
38 | public Term(Object object) { |
||
39 | this.object = object; |
||
40 | } |
||
41 | |||
42 | public Term(Object object, String name, |
||
43 | Set<Relationship> relationshipsForTermTo, |
||
44 | Set<Relationship> relationshipsForTermFrom) { |
||
45 | this.object = object; |
||
46 | this.name = name; |
||
47 | this.relationshipsForTermTo = relationshipsForTermTo; |
||
48 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
||
49 | } |
||
50 | |||
51 | @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object")) |
||
52 | @Id |
||
53 | @GeneratedValue(generator = "generator") |
||
54 | @Column(name = "object_id", unique = true, nullable = false) |
||
55 | public int getObjectId() { |
||
56 | return this.objectId; |
||
57 | } |
||
58 | |||
59 | public void setObjectId(int objectId) { |
||
60 | this.objectId = objectId; |
||
61 | } |
||
62 | |||
63 | @OneToOne(fetch = FetchType.LAZY) |
||
64 | @PrimaryKeyJoinColumn |
||
65 | public Object getObject() { |
||
66 | return this.object; |
||
67 | } |
||
68 | |||
69 | public void setObject(Object object) { |
||
70 | this.object = object; |
||
71 | } |
||
72 | |||
73 | @Column(name = "name", unique = true) |
||
74 | public String getName() { |
||
75 | return this.name; |
||
76 | } |
||
77 | |||
78 | public void setName(String name) { |
||
79 | this.name = name; |
||
80 | } |
||
81 | |||
82 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermTo") |
||
83 | public Set<Relationship> getRelationshipsForTermTo() { |
||
84 | return this.relationshipsForTermTo; |
||
85 | } |
||
86 | |||
87 | public void setRelationshipsForTermTo( |
||
88 | Set<Relationship> relationshipsForTermTo) { |
||
89 | this.relationshipsForTermTo = relationshipsForTermTo; |
||
90 | } |
||
91 | |||
92 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermFrom") |
||
93 | public Set<Relationship> getRelationshipsForTermFrom() { |
||
94 | return this.relationshipsForTermFrom; |
||
95 | } |
||
96 | |||
97 | public void setRelationshipsForTermFrom( |
||
98 | Set<Relationship> relationshipsForTermFrom) { |
||
99 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
||
100 | } |
||
101 | |||
102 | } |