Rev 33 | Go to most recent revision | Details | Compare with Previous | 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 | |||
33 | PointedEar | 5 | import java.io.Serializable; |
21 | moos | 6 | import java.util.HashSet; |
7 | import java.util.Set; |
||
33 | PointedEar | 8 | |
9 | import javax.persistence.CascadeType; |
||
21 | moos | 10 | import javax.persistence.Column; |
11 | import javax.persistence.Entity; |
||
12 | import javax.persistence.FetchType; |
||
13 | import javax.persistence.GeneratedValue; |
||
14 | import javax.persistence.Id; |
||
15 | import javax.persistence.OneToMany; |
||
16 | import javax.persistence.OneToOne; |
||
17 | import javax.persistence.PrimaryKeyJoinColumn; |
||
18 | import javax.persistence.Table; |
||
33 | PointedEar | 19 | import javax.persistence.Transient; |
21 | moos | 20 | import javax.persistence.UniqueConstraint; |
33 | PointedEar | 21 | |
21 | moos | 22 | import org.hibernate.annotations.GenericGenerator; |
23 | import org.hibernate.annotations.Parameter; |
||
24 | |||
25 | /** |
||
26 | * Term generated by hbm2java |
||
27 | */ |
||
28 | @Entity |
||
29 | @Table(name = "term", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name")) |
||
33 | PointedEar | 30 | public class Term implements Serializable |
31 | { |
||
32 | /** |
||
33 | * Version ID for serialization |
||
34 | */ |
||
35 | private static final long serialVersionUID = 1L; |
||
21 | moos | 36 | |
33 | PointedEar | 37 | @Transient |
38 | private int objectId; |
||
21 | moos | 39 | |
33 | PointedEar | 40 | private ObjectEntity object; |
41 | private String name; |
||
42 | private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>( |
||
43 | 0); |
||
44 | private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>( |
||
45 | 0); |
||
21 | moos | 46 | |
33 | PointedEar | 47 | /** |
34 | PointedEar | 48 | * @var <code>true</code> if the term is edited/renamed, <code>false</code> |
49 | * otherwise |
||
50 | */ |
||
51 | public boolean edit = false; |
||
52 | |||
53 | /** |
||
33 | PointedEar | 54 | * No-op constructor |
55 | */ |
||
56 | public Term() |
||
57 | { |
||
58 | } |
||
21 | moos | 59 | |
33 | PointedEar | 60 | /** |
61 | * @param object |
||
62 | */ |
||
63 | public Term(ObjectEntity object) |
||
64 | { |
||
65 | this.object = object; |
||
66 | } |
||
21 | moos | 67 | |
33 | PointedEar | 68 | /** |
69 | * @param object |
||
70 | * @param name |
||
71 | * @param relationshipsForTermTo |
||
72 | * @param relationshipsForTermFrom |
||
73 | */ |
||
74 | public Term(ObjectEntity object, String name, |
||
75 | Set<Relationship> relationshipsForTermTo, |
||
76 | Set<Relationship> relationshipsForTermFrom) |
||
77 | { |
||
78 | this.object = object; |
||
79 | this.name = name; |
||
80 | this.relationshipsForTermTo = relationshipsForTermTo; |
||
81 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
||
82 | } |
||
21 | moos | 83 | |
33 | PointedEar | 84 | /** |
85 | * @return |
||
86 | */ |
||
87 | @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object")) |
||
88 | @Id |
||
89 | @GeneratedValue(generator = "generator") |
||
90 | @Column(name = "object_id", unique = true, nullable = false) |
||
91 | public int getObjectId() |
||
92 | { |
||
93 | return this.objectId; |
||
94 | } |
||
21 | moos | 95 | |
33 | PointedEar | 96 | /** |
97 | * @param objectId |
||
98 | */ |
||
99 | public void setObjectId(int objectId) |
||
100 | { |
||
101 | this.objectId = objectId; |
||
102 | } |
||
21 | moos | 103 | |
33 | PointedEar | 104 | /** |
105 | * @return ObjectEntity domain object |
||
106 | */ |
||
107 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
||
108 | @PrimaryKeyJoinColumn |
||
109 | public ObjectEntity getObject() |
||
110 | { |
||
111 | return this.object; |
||
112 | } |
||
21 | moos | 113 | |
33 | PointedEar | 114 | /** |
115 | * @param object |
||
116 | */ |
||
117 | public void setObject(ObjectEntity object) |
||
118 | { |
||
119 | this.object = object; |
||
120 | } |
||
21 | moos | 121 | |
33 | PointedEar | 122 | /** |
123 | * @return |
||
124 | */ |
||
125 | @Column(name = "name", unique = true) |
||
126 | public String getName() |
||
127 | { |
||
128 | return this.name; |
||
129 | } |
||
21 | moos | 130 | |
33 | PointedEar | 131 | /** |
132 | * @param name |
||
133 | */ |
||
134 | public void setName(String name) |
||
135 | { |
||
136 | this.name = name; |
||
137 | } |
||
21 | moos | 138 | |
34 | PointedEar | 139 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termTo") |
33 | PointedEar | 140 | public Set<Relationship> getRelationshipsForTermTo() |
141 | { |
||
142 | return this.relationshipsForTermTo; |
||
143 | } |
||
21 | moos | 144 | |
33 | PointedEar | 145 | /** |
146 | * @param relationshipsForTermTo |
||
147 | */ |
||
148 | public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo) |
||
149 | { |
||
150 | this.relationshipsForTermTo = relationshipsForTermTo; |
||
151 | } |
||
21 | moos | 152 | |
33 | PointedEar | 153 | /** |
154 | * @return |
||
155 | */ |
||
34 | PointedEar | 156 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termFrom") |
33 | PointedEar | 157 | public Set<Relationship> getRelationshipsForTermFrom() |
158 | { |
||
159 | return this.relationshipsForTermFrom; |
||
160 | } |
||
21 | moos | 161 | |
33 | PointedEar | 162 | /** |
163 | * @param relationshipsForTermFrom |
||
164 | */ |
||
165 | public void setRelationshipsForTermFrom( |
||
166 | Set<Relationship> relationshipsForTermFrom) |
||
167 | { |
||
168 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
||
169 | } |
||
170 | |||
21 | moos | 171 | } |