Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
RecipientPreference |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007-2008 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kcb.bo; | |
17 | ||
18 | ||
19 | import javax.persistence.Column; | |
20 | import javax.persistence.Entity; | |
21 | import javax.persistence.Id; | |
22 | import javax.persistence.Table; | |
23 | import javax.persistence.Version; | |
24 | ||
25 | import org.apache.commons.lang.builder.ToStringBuilder; | |
26 | ||
27 | /** | |
28 | * This class represents a recipient preference in the system. This is a generic Key/Value structure | |
29 | * that is used by the system to store preferences that the user has set up. This will be | |
30 | * used by the tickler plugins which will need a generic and dynamic structure for user specific settings. | |
31 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
32 | */ | |
33 | @Entity | |
34 | @Table(name="KREN_RECIP_PREFS_T") | |
35 | 0 | public class RecipientPreference { |
36 | ||
37 | /** | |
38 | * Field names for queries | |
39 | */ | |
40 | public static final String RECIPIENT_FIELD = "recipientId"; | |
41 | public static final String PROPERTY_FIELD = "property"; | |
42 | ||
43 | @Id | |
44 | @Column(name="RECIP_PREFS_ID") | |
45 | private Long id; | |
46 | @Column(name="RECIP_ID", nullable=false) | |
47 | private String recipientId; | |
48 | @Column(name="PROP", nullable=false) | |
49 | private String property; | |
50 | @Column(name="VAL", nullable=true) | |
51 | private String value; | |
52 | ||
53 | /** | |
54 | * Lock column for OJB optimistic locking | |
55 | */ | |
56 | @Version | |
57 | @Column(name="VER_NBR") | |
58 | private Integer lockVerNbr; | |
59 | ||
60 | /** | |
61 | * Gets the id attribute. | |
62 | * @return Returns the id. | |
63 | */ | |
64 | public Long getId() { | |
65 | 0 | return id; |
66 | } | |
67 | ||
68 | /** | |
69 | * Sets the id attribute value. | |
70 | * @param id The id to set. | |
71 | */ | |
72 | public void setId(Long id) { | |
73 | 0 | this.id = id; |
74 | 0 | } |
75 | ||
76 | /** | |
77 | * Gets the property attribute. | |
78 | * @return Returns the property. | |
79 | */ | |
80 | public String getProperty() { | |
81 | 0 | return property; |
82 | } | |
83 | ||
84 | /** | |
85 | * Sets the property attribute value. | |
86 | * @param property The property to set. | |
87 | */ | |
88 | public void setProperty(String property) { | |
89 | 0 | this.property = property; |
90 | 0 | } |
91 | ||
92 | /** | |
93 | * Gets the recipientId attribute. | |
94 | * @return Returns the recipientId. | |
95 | */ | |
96 | public String getRecipientId() { | |
97 | 0 | return recipientId; |
98 | } | |
99 | ||
100 | /** | |
101 | * Sets the recipientId attribute value. | |
102 | * @param recipientId The recipientId to set. | |
103 | */ | |
104 | public void setRecipientId(String recipientId) { | |
105 | 0 | this.recipientId = recipientId; |
106 | 0 | } |
107 | ||
108 | /** | |
109 | * Gets the value attribute. | |
110 | * @return Returns the value. | |
111 | */ | |
112 | public String getValue() { | |
113 | 0 | return value; |
114 | } | |
115 | ||
116 | /** | |
117 | * Sets the value attribute value. | |
118 | * @param value The value to set. | |
119 | */ | |
120 | public void setValue(String value) { | |
121 | 0 | this.value = value; |
122 | 0 | } |
123 | ||
124 | /** | |
125 | * Return value of lock column for OJB optimistic locking | |
126 | * @return value of lock column for OJB optimistic locking | |
127 | */ | |
128 | public Integer getLockVerNbr() { | |
129 | 0 | return lockVerNbr; |
130 | } | |
131 | ||
132 | /** | |
133 | * Set value of lock column for OJB optimistic locking | |
134 | * @param lockVerNbr value of lock column for OJB optimistic locking | |
135 | */ | |
136 | public void setLockVerNbr(Integer lockVerNbr) { | |
137 | 0 | this.lockVerNbr = lockVerNbr; |
138 | 0 | } |
139 | ||
140 | /** | |
141 | * @see java.lang.Object#clone() | |
142 | */ | |
143 | // @Override | |
144 | // public Object clone() throws CloneNotSupportedException { | |
145 | // return super.clone(); | |
146 | // } | |
147 | ||
148 | /** | |
149 | * @see java.lang.Object#toString() | |
150 | */ | |
151 | @Override | |
152 | public String toString() { | |
153 | 0 | return new ToStringBuilder(this) |
154 | .append("id", id) | |
155 | .append("recipientId", recipientId) | |
156 | .append("property", property) | |
157 | .append("value", value) | |
158 | .append("lockVerNbr", lockVerNbr) | |
159 | .toString(); | |
160 | } | |
161 | } |