1
2
3
4 package org.marketchangers.prayer;
5
6 import java.util.Date;
7
8 /***
9 * @author Jason Williams
10 * @hibernate.class table="PrayerRequests"
11 */
12 public class PrayerRequest extends PersistentObject {
13
14 private String status;
15 private String subject;
16 private String content;
17 private Date startDate;
18 private Date endDate;
19 private String background;
20 private PrayerCategory category;
21 private String requestorUserId;
22
23
24 public static final String OPEN = "open";
25 public static final String CLOSED = "closed";
26
27 /***
28 * @hibernate.property
29 * @return
30 */
31 public String getBackground() {
32 return background;
33 }
34
35 /***
36 * @hibernate.many-to-one
37 * class="org.marketchangers.prayer.PrayerCategory"
38 * @return
39 */
40 public PrayerCategory getCategory() {
41 return category;
42 }
43
44 /***
45 * @hibernate.property
46 * @return
47 */
48 public String getContent() {
49 return content;
50 }
51
52 /***
53 * @hibernate.property
54 * @return
55 */
56 public Date getEndDate() {
57 return endDate;
58 }
59
60 /***
61 * @hibernate.property
62 * @return
63 */
64 public Date getStartDate() {
65 return startDate;
66 }
67
68 /***
69 * @hibernate.property
70 * @return
71 */
72 public String getStatus() {
73 return status;
74 }
75
76 /***
77 * @hibernate.property
78 * @return
79 */
80 public String getSubject() {
81 return subject;
82 }
83
84 /***
85 * @param string
86 */
87 public void setBackground(String string) {
88 background = string;
89 }
90
91 /***
92 * @param category
93 */
94 public void setCategory(PrayerCategory category) {
95 this.category = category;
96 }
97
98 /***
99 * @param string
100 */
101 public void setContent(String string) {
102 content = string;
103 }
104
105 /***
106 * @param date
107 */
108 public void setEndDate(Date date) {
109 endDate = date;
110 }
111
112 /***
113 * @param date
114 */
115 public void setStartDate(Date date) {
116 startDate = date;
117 }
118
119 /***
120 * @param string
121 */
122 public void setStatus(String string) {
123 status = string;
124 }
125
126 /***
127 * @param string
128 */
129 public void setSubject(String string) {
130 subject = string;
131 }
132
133 public boolean equals(Object o) {
134 if (o == this) {
135 return true;
136 }
137
138 if (!(o instanceof PrayerRequest)) {
139 return false;
140 }
141
142 PrayerRequest other = (PrayerRequest) o;
143 return equals(this.background, other.background)
144 && equals(this.category, other.category)
145 && equals(this.content, other.content)
146 && equals(this.startDate, other.startDate)
147 && equals(this.endDate, other.endDate)
148 && equals(this.requestorUserId, other.requestorUserId);
149 }
150
151 private boolean equals(Object lhs, Object rhs) {
152 return lhs == null ? rhs == null : lhs.equals(rhs);
153 }
154
155 public int hashCode() {
156 int result = 10;
157 result = result * 37 + hashCode(background);
158 result = result * 37 + hashCode(content);
159 result = result * 37 + hashCode(category);
160 result = result * 37 + hashCode(startDate);
161 result = result * 37 + hashCode(endDate);
162
163 return result;
164 }
165
166 private int hashCode(Object o) {
167 return o == null ? 0 : o.hashCode();
168 }
169
170 /***
171 * @hibernate.property
172 * @return
173 */
174 public String getRequestorUserId() {
175 return requestorUserId;
176 }
177
178 /***
179 * @param string
180 */
181 public void setRequestorUserId(String string) {
182 requestorUserId = string;
183 }
184
185 }