Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
919 | dev | 1 | package ak.hostcaptain.core.model; |
2 | |||
3 | import java.util.Date; |
||
4 | import ak.hostcaptain.util.ModelException; |
||
5 | import ak.hostcaptain.util.ModelSecurityException; |
||
6 | |||
7 | public abstract class GeneralModelObject |
||
8 | implements ModelObject |
||
9 | { |
||
10 | private Boolean enabled; |
||
11 | private String comment; |
||
12 | private Date modStamp; |
||
918 | dev | 13 | private User modUser; |
919 | dev | 14 | |
918 | dev | 15 | /** |
16 | * |
||
919 | dev | 17 | * @hibernate.property |
18 | */ |
||
19 | public Boolean getEnabled() |
||
20 | { |
||
21 | return enabled; |
||
22 | } |
||
23 | |||
24 | public void setEnabled(Boolean enabled) |
||
25 | { |
||
26 | this.enabled = enabled; |
||
27 | } |
||
28 | |||
29 | public void setEnabled(User editor, Boolean enabled) |
||
30 | throws ModelException |
||
31 | { |
||
32 | if(!editableBy(editor)) |
||
33 | throw new ModelSecurityException(); |
||
34 | |||
35 | this.enabled = enabled; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * |
||
40 | * @hibernate.property |
||
41 | */ |
||
42 | public String getComment() |
||
43 | { |
||
44 | return comment; |
||
45 | } |
||
46 | |||
47 | public void setComment(String comment) |
||
48 | { |
||
49 | this.comment = comment; |
||
50 | } |
||
51 | |||
52 | public void setComment(User editor, String comment) |
||
53 | throws ModelException |
||
54 | { |
||
55 | if(!editableBy(editor)) |
||
56 | throw new ModelSecurityException(); |
||
57 | |||
58 | this.comment = comment; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * |
||
63 | * @hibernate.timestamp column="mod_stamp" |
||
64 | */ |
||
65 | public Date getModStamp() |
||
66 | { |
||
67 | return modStamp; |
||
68 | } |
||
69 | |||
70 | protected void setModStamp(Date modStamp) |
||
71 | { |
||
72 | this.modStamp = modStamp; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * |
||
918 | dev | 77 | * @hibernate.many-to-one column="mod_user" |
78 | */ |
||
79 | public User getModUser() |
||
80 | { |
||
81 | return modUser; |
||
82 | } |
||
83 | |||
84 | protected void setModUser(User modUser) |
||
85 | { |
||
86 | this.modUser = modUser; |
||
87 | } |
||
919 | dev | 88 | } |