Rev 33 | 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 static javax.persistence.GenerationType.IDENTITY; |
6 | |||
7 | import java.io.Serializable; |
||
21 | moos | 8 | import java.util.Date; |
9 | import java.util.HashSet; |
||
10 | import java.util.Set; |
||
33 | PointedEar | 11 | |
21 | moos | 12 | import javax.persistence.Column; |
13 | import javax.persistence.Entity; |
||
14 | import javax.persistence.FetchType; |
||
15 | import javax.persistence.GeneratedValue; |
||
16 | import javax.persistence.Id; |
||
17 | import javax.persistence.JoinColumn; |
||
18 | import javax.persistence.ManyToOne; |
||
19 | import javax.persistence.OneToMany; |
||
20 | import javax.persistence.OneToOne; |
||
21 | import javax.persistence.Table; |
||
22 | import javax.persistence.Temporal; |
||
23 | import javax.persistence.TemporalType; |
||
24 | |||
37 | PointedEar | 25 | import org.hibernate.annotations.OrderBy; |
26 | |||
21 | moos | 27 | /** |
33 | PointedEar | 28 | * ObjectEntity generated by hbm2java |
21 | moos | 29 | */ |
30 | @Entity |
||
31 | @Table(name = "object", catalog = "webengineering") |
||
33 | PointedEar | 32 | public class ObjectEntity implements Serializable |
33 | { |
||
34 | /** |
||
35 | * Version ID for serialization |
||
36 | */ |
||
37 | private static final long serialVersionUID = 1L; |
||
21 | moos | 38 | |
33 | PointedEar | 39 | /* Persistent fields */ |
40 | private Integer id; |
||
41 | private User userByEditorId; |
||
42 | private ObjectType objectType; |
||
43 | private User userByOwnerId; |
||
44 | private Date locked; |
||
45 | private Date modified; |
||
46 | private Boolean deleted; |
||
47 | private Term term; |
||
37 | PointedEar | 48 | private Set<History> history = new HashSet<History>(0); |
33 | PointedEar | 49 | private Relationship relationship; |
21 | moos | 50 | |
33 | PointedEar | 51 | /** |
52 | * |
||
53 | */ |
||
54 | public ObjectEntity() |
||
55 | { |
||
56 | } |
||
21 | moos | 57 | |
33 | PointedEar | 58 | /** |
59 | * @param userByEditorId |
||
60 | * @param objectType |
||
61 | * @param userByOwnerId |
||
62 | */ |
||
63 | public ObjectEntity(User userByEditorId, ObjectType objectType, |
||
64 | User userByOwnerId) |
||
65 | { |
||
66 | this.userByEditorId = userByEditorId; |
||
67 | this.objectType = objectType; |
||
68 | this.userByOwnerId = userByOwnerId; |
||
69 | } |
||
21 | moos | 70 | |
33 | PointedEar | 71 | /** |
72 | * @param userByEditorId |
||
73 | * @param objectType |
||
74 | * @param userByOwnerId |
||
75 | * @param locked |
||
76 | * @param modified |
||
77 | * @param deleted |
||
78 | * @param term |
||
37 | PointedEar | 79 | * @param history |
33 | PointedEar | 80 | * @param relationship |
81 | */ |
||
82 | public ObjectEntity(User userByEditorId, ObjectType objectType, |
||
83 | User userByOwnerId, Date locked, Date modified, Boolean deleted, |
||
84 | Term term, Set<History> histories, Relationship relationship) |
||
85 | { |
||
86 | this.userByEditorId = userByEditorId; |
||
87 | this.objectType = objectType; |
||
88 | this.userByOwnerId = userByOwnerId; |
||
89 | this.locked = locked; |
||
90 | this.modified = modified; |
||
91 | this.deleted = deleted; |
||
92 | this.term = term; |
||
37 | PointedEar | 93 | this.history = histories; |
33 | PointedEar | 94 | this.relationship = relationship; |
95 | } |
||
21 | moos | 96 | |
33 | PointedEar | 97 | /** |
98 | * @return |
||
99 | */ |
||
100 | @Id |
||
101 | @GeneratedValue(strategy = IDENTITY) |
||
102 | @Column(name = "id", unique = true, nullable = false) |
||
103 | public Integer getId() |
||
104 | { |
||
105 | return this.id; |
||
106 | } |
||
21 | moos | 107 | |
33 | PointedEar | 108 | /** |
109 | * @param id |
||
110 | */ |
||
111 | public void setId(Integer id) |
||
112 | { |
||
113 | this.id = id; |
||
114 | } |
||
21 | moos | 115 | |
33 | PointedEar | 116 | /** |
117 | * @return |
||
118 | */ |
||
119 | @ManyToOne(fetch = FetchType.LAZY) |
||
120 | @JoinColumn(name = "editor_id", nullable = false) |
||
121 | public User getUserByEditorId() |
||
122 | { |
||
123 | return this.userByEditorId; |
||
124 | } |
||
21 | moos | 125 | |
33 | PointedEar | 126 | /** |
127 | * @param userByEditorId |
||
128 | */ |
||
129 | public void setUserByEditorId(User userByEditorId) |
||
130 | { |
||
131 | this.userByEditorId = userByEditorId; |
||
132 | } |
||
21 | moos | 133 | |
33 | PointedEar | 134 | /** |
135 | * @return |
||
136 | */ |
||
137 | @ManyToOne(fetch = FetchType.LAZY) |
||
138 | @JoinColumn(name = "object_type_id", nullable = false) |
||
139 | public ObjectType getObjectType() |
||
140 | { |
||
141 | return this.objectType; |
||
142 | } |
||
21 | moos | 143 | |
33 | PointedEar | 144 | /** |
145 | * @param objectType |
||
146 | */ |
||
147 | public void setObjectType(ObjectType objectType) |
||
148 | { |
||
149 | this.objectType = objectType; |
||
150 | } |
||
21 | moos | 151 | |
33 | PointedEar | 152 | /** |
153 | * @return |
||
154 | */ |
||
155 | @ManyToOne(fetch = FetchType.LAZY) |
||
156 | @JoinColumn(name = "owner_id", nullable = false) |
||
157 | public User getUserByOwnerId() |
||
158 | { |
||
159 | return this.userByOwnerId; |
||
160 | } |
||
21 | moos | 161 | |
33 | PointedEar | 162 | /** |
163 | * @param userByOwnerId |
||
164 | */ |
||
165 | public void setUserByOwnerId(User userByOwnerId) |
||
166 | { |
||
167 | this.userByOwnerId = userByOwnerId; |
||
168 | } |
||
21 | moos | 169 | |
33 | PointedEar | 170 | /** |
171 | * @return |
||
172 | */ |
||
173 | @Temporal(TemporalType.TIMESTAMP) |
||
174 | @Column(name = "locked", length = 19) |
||
175 | public Date getLocked() |
||
176 | { |
||
177 | return this.locked; |
||
178 | } |
||
21 | moos | 179 | |
33 | PointedEar | 180 | /** |
181 | * @param locked |
||
182 | */ |
||
183 | public void setLocked(Date locked) |
||
184 | { |
||
185 | this.locked = locked; |
||
186 | } |
||
21 | moos | 187 | |
33 | PointedEar | 188 | /** |
189 | * @return |
||
190 | */ |
||
191 | @Temporal(TemporalType.TIMESTAMP) |
||
192 | @Column(name = "modified", length = 19) |
||
193 | public Date getModified() |
||
194 | { |
||
195 | return this.modified; |
||
196 | } |
||
21 | moos | 197 | |
33 | PointedEar | 198 | /** |
199 | * @param modified |
||
200 | */ |
||
201 | public void setModified(Date modified) |
||
202 | { |
||
203 | this.modified = modified; |
||
204 | } |
||
21 | moos | 205 | |
33 | PointedEar | 206 | /** |
207 | * @return |
||
208 | */ |
||
209 | @Column(name = "deleted") |
||
210 | public Boolean getDeleted() |
||
211 | { |
||
212 | return this.deleted; |
||
213 | } |
||
21 | moos | 214 | |
33 | PointedEar | 215 | /** |
216 | * @param deleted |
||
217 | */ |
||
218 | public void setDeleted(Boolean deleted) |
||
219 | { |
||
220 | this.deleted = deleted; |
||
221 | } |
||
21 | moos | 222 | |
33 | PointedEar | 223 | /** |
224 | * @return |
||
225 | */ |
||
226 | @OneToOne(fetch = FetchType.LAZY, mappedBy = "object") |
||
227 | public Term getTerm() |
||
228 | { |
||
229 | return this.term; |
||
230 | } |
||
21 | moos | 231 | |
33 | PointedEar | 232 | /** |
233 | * @param term |
||
234 | */ |
||
235 | public void setTerm(Term term) |
||
236 | { |
||
237 | this.term = term; |
||
238 | } |
||
21 | moos | 239 | |
33 | PointedEar | 240 | /** |
241 | * @return |
||
242 | */ |
||
243 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "object") |
||
37 | PointedEar | 244 | @OrderBy(clause = "date DESC") |
245 | public Set<History> getHistory() |
||
33 | PointedEar | 246 | { |
37 | PointedEar | 247 | return this.history; |
33 | PointedEar | 248 | } |
21 | moos | 249 | |
33 | PointedEar | 250 | /** |
37 | PointedEar | 251 | * @param history |
33 | PointedEar | 252 | */ |
37 | PointedEar | 253 | public void setHistory(Set<History> history) |
33 | PointedEar | 254 | { |
37 | PointedEar | 255 | this.history = history; |
33 | PointedEar | 256 | } |
21 | moos | 257 | |
33 | PointedEar | 258 | /** |
259 | * @return |
||
260 | */ |
||
261 | @OneToOne(fetch = FetchType.LAZY, mappedBy = "object") |
||
262 | public Relationship getRelationship() |
||
263 | { |
||
264 | return this.relationship; |
||
265 | } |
||
21 | moos | 266 | |
33 | PointedEar | 267 | /** |
268 | * @param relationship |
||
269 | */ |
||
270 | public void setRelationship(Relationship relationship) |
||
271 | { |
||
272 | this.relationship = relationship; |
||
273 | } |
||
21 | moos | 274 | |
275 | } |