| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.ken.bo; |
| 17 | |
|
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.List; |
| 20 | |
|
| 21 | |
import javax.persistence.CascadeType; |
| 22 | |
import javax.persistence.Column; |
| 23 | |
import javax.persistence.Entity; |
| 24 | |
import javax.persistence.FetchType; |
| 25 | |
import javax.persistence.Id; |
| 26 | |
import javax.persistence.JoinColumn; |
| 27 | |
import javax.persistence.JoinTable; |
| 28 | |
import javax.persistence.ManyToMany; |
| 29 | |
import javax.persistence.OneToMany; |
| 30 | |
import javax.persistence.Table; |
| 31 | |
import javax.persistence.Transient; |
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
@Entity |
| 41 | |
@Table(name = "KREN_CHNL_T") |
| 42 | |
public class NotificationChannel { |
| 43 | |
@Id |
| 44 | |
@Column(name = "CHNL_ID") |
| 45 | |
private Long id; |
| 46 | |
@Column(name = "NM", nullable = false) |
| 47 | |
private String name; |
| 48 | |
@Column(name = "DESC_TXT", nullable = false) |
| 49 | |
private String description; |
| 50 | |
@Column(name = "SUBSCRB_IND", nullable = false) |
| 51 | |
private boolean subscribable; |
| 52 | |
|
| 53 | |
|
| 54 | |
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE}, targetEntity = org.kuali.rice.ken.bo.NotificationRecipientList.class, mappedBy = "channel") |
| 55 | |
private List<NotificationRecipientList> recipientLists; |
| 56 | |
@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE}) |
| 57 | |
@JoinTable(name = "NOTIFICATION_CHANNEL_PRODUCERS", joinColumns = @JoinColumn(name = "CHNL_ID"), inverseJoinColumns = @JoinColumn(name = "PRODCR_ID")) |
| 58 | |
private List<NotificationProducer> producers; |
| 59 | 0 | @Transient |
| 60 | |
private List<NotificationChannelReviewer> reviewers = new ArrayList<NotificationChannelReviewer>(); |
| 61 | 0 | @Transient |
| 62 | |
private List<UserChannelSubscription> subscriptions = new ArrayList<UserChannelSubscription>(); |
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
public NotificationChannel() { |
| 68 | 0 | super(); |
| 69 | 0 | recipientLists = new ArrayList<NotificationRecipientList>(); |
| 70 | 0 | producers = new ArrayList<NotificationProducer>(); |
| 71 | 0 | } |
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
public List<NotificationRecipientList> getRecipientLists() { |
| 79 | 0 | return recipientLists; |
| 80 | |
} |
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
public void setRecipientLists(List<NotificationRecipientList> recipientLists) { |
| 89 | 0 | this.recipientLists = recipientLists; |
| 90 | 0 | } |
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
public void addRecipientList(NotificationRecipientList recipientList) { |
| 98 | 0 | this.recipientLists.add(recipientList); |
| 99 | 0 | } |
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
public void removeRecipientList(NotificationRecipientList recipientList) { |
| 107 | 0 | this.recipientLists.remove(recipientList); |
| 108 | 0 | } |
| 109 | |
|
| 110 | |
|
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
public String getDescription() { |
| 116 | 0 | return description; |
| 117 | |
} |
| 118 | |
|
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
public void setDescription(String description) { |
| 126 | 0 | this.description = description; |
| 127 | 0 | } |
| 128 | |
|
| 129 | |
|
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
public Long getId() { |
| 135 | 0 | return id; |
| 136 | |
} |
| 137 | |
|
| 138 | |
|
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
|
| 143 | |
|
| 144 | |
public void setId(Long id) { |
| 145 | 0 | this.id = id; |
| 146 | 0 | } |
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
|
| 152 | |
|
| 153 | |
public String getName() { |
| 154 | 0 | return name; |
| 155 | |
} |
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
|
| 160 | |
|
| 161 | |
|
| 162 | |
|
| 163 | |
public void setName(String name) { |
| 164 | 0 | this.name = name; |
| 165 | 0 | } |
| 166 | |
|
| 167 | |
|
| 168 | |
|
| 169 | |
|
| 170 | |
|
| 171 | |
|
| 172 | |
public boolean isSubscribable() { |
| 173 | 0 | return subscribable; |
| 174 | |
} |
| 175 | |
|
| 176 | |
|
| 177 | |
|
| 178 | |
|
| 179 | |
|
| 180 | |
|
| 181 | |
|
| 182 | |
public void setSubscribable(boolean subscribable) { |
| 183 | 0 | this.subscribable = subscribable; |
| 184 | 0 | } |
| 185 | |
|
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
|
| 190 | |
|
| 191 | |
public List<NotificationProducer> getProducers() { |
| 192 | 0 | return producers; |
| 193 | |
} |
| 194 | |
|
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
public void setProducers(List<NotificationProducer> producers) { |
| 202 | 0 | this.producers = producers; |
| 203 | 0 | } |
| 204 | |
|
| 205 | |
|
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | |
|
| 210 | |
public List<NotificationChannelReviewer> getReviewers() { |
| 211 | 0 | return reviewers; |
| 212 | |
} |
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
public void setReviewers(List<NotificationChannelReviewer> reviewers) { |
| 221 | 0 | this.reviewers = reviewers; |
| 222 | 0 | } |
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
|
| 227 | |
|
| 228 | |
|
| 229 | |
public List<UserChannelSubscription> getSubscriptions() { |
| 230 | 0 | return subscriptions; |
| 231 | |
} |
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
|
| 236 | |
|
| 237 | |
|
| 238 | |
|
| 239 | |
public void setSubscriptions(List<UserChannelSubscription> subscriptions) { |
| 240 | 0 | this.subscriptions = subscriptions; |
| 241 | 0 | } |
| 242 | |
|
| 243 | |
|
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
@Override |
| 249 | |
public boolean equals(Object obj) { |
| 250 | 0 | NotificationChannel channelToCompare = (NotificationChannel) obj; |
| 251 | 0 | return this.getId().equals(channelToCompare.getId()); |
| 252 | |
} |
| 253 | |
|
| 254 | |
} |