1
2
3
4 package org.marketchangers.prayer;
5
6 import java.util.Date;
7
8 /***
9 * @author Jason Williams
10 * @hibernate.class table="PrayerComments"
11 */
12 public class PrayerComment extends PersistentObject {
13
14 private PrayerRequest parentRequest;
15 private Date postDate;
16 private String authorUserId;
17 private String content;
18
19 /***
20 * @hibernate.property
21 * @return
22 */
23 public String getContent() {
24 return content;
25 }
26
27 /***
28 * @hibernate.timestamp
29 * @return
30 */
31 public Date getPostDate() {
32 return postDate;
33 }
34
35 /***
36 * @param string
37 */
38 public void setContent(String string) {
39 content = string;
40 }
41
42 /***
43 * @param date
44 */
45 public void setPostDate(Date date) {
46 postDate = date;
47 }
48
49 /***
50 * @hibernate.property
51 * @return
52 */
53 public String getAuthorUserId() {
54 return authorUserId;
55 }
56
57 /***
58 * @hibernate.many-to-one
59 * class="org.marketchangers.prayer.PrayerRequest"
60 * @return
61 */
62 public PrayerRequest getParentRequest() {
63 return parentRequest;
64 }
65
66 /***
67 * @param string
68 */
69 public void setAuthorUserId(String string) {
70 authorUserId = string;
71 }
72
73 /***
74 * @param request
75 */
76 public void setParentRequest(PrayerRequest request) {
77 parentRequest = request;
78 }
79
80 public boolean equals(Object o) {
81 if (o == this) {
82 return true;
83 }
84
85 if (!(o instanceof PrayerComment)) {
86 return false;
87 }
88
89 PrayerComment other = (PrayerComment)o;
90 return equals(this.authorUserId, other.authorUserId)
91 && equals(this.content, other.content)
92 && equals(this.postDate, other.postDate)
93 && equals(this.parentRequest, other.parentRequest);
94 }
95
96 private boolean equals(Object lhs, Object rhs) {
97 return lhs == null ? rhs == null : lhs.equals(rhs);
98 }
99
100 public int hashCode() {
101 int result = 10;
102 result = result * 37 + hashCode(authorUserId);
103 result = result * 37 + hashCode(content);
104 result = result * 37 + hashCode(postDate);
105 result = result * 37 + hashCode(parentRequest);
106
107 return result;
108 }
109
110 private int hashCode(Object o) {
111 return o == null ? 0 : o.hashCode();
112 }
113
114 }