Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NotificationProducer |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 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.ken.bo; | |
17 | ||
18 | import javax.persistence.FetchType; | |
19 | import javax.persistence.JoinColumn; | |
20 | import javax.persistence.JoinTable; | |
21 | import javax.persistence.ManyToMany; | |
22 | import javax.persistence.Column; | |
23 | import javax.persistence.Id; | |
24 | import javax.persistence.CascadeType; | |
25 | import javax.persistence.Table; | |
26 | import javax.persistence.Entity; | |
27 | ||
28 | import java.util.ArrayList; | |
29 | import java.util.List; | |
30 | ||
31 | import org.apache.commons.lang.builder.ToStringBuilder; | |
32 | ||
33 | /** | |
34 | * This class represents an instance of who can actually submit notification messages to the system | |
35 | * for processing. | |
36 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
37 | */ | |
38 | @Entity | |
39 | @Table(name="KREN_PRODCR_T") | |
40 | public class NotificationProducer { | |
41 | @Id | |
42 | @Column(name="PRODCR_ID") | |
43 | private Long id; | |
44 | @Column(name="NM", nullable=false) | |
45 | private String name; | |
46 | @Column(name="DESC_TXT", nullable=false) | |
47 | private String description; | |
48 | @Column(name="CNTCT_INFO", nullable=false) | |
49 | private String contactInfo; | |
50 | ||
51 | // List references | |
52 | @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST, CascadeType.MERGE})@JoinTable(name="NOTIFICATION_CHANNEL_PRODUCERS", | |
53 | joinColumns=@JoinColumn(name="PRODCR_ID"), | |
54 | inverseJoinColumns=@JoinColumn(name="CHNL_ID")) | |
55 | private List<NotificationChannel> channels; | |
56 | ||
57 | /** | |
58 | * Constructs a NotificationProducer instance. | |
59 | */ | |
60 | 0 | public NotificationProducer() { |
61 | 0 | channels = new ArrayList<NotificationChannel>(); |
62 | 0 | } |
63 | ||
64 | /** | |
65 | * Gets the contactInfo attribute. | |
66 | * @return Returns the contactInfo. | |
67 | */ | |
68 | public String getContactInfo() { | |
69 | 0 | return contactInfo; |
70 | } | |
71 | ||
72 | /** | |
73 | * Sets the contactInfo attribute value. | |
74 | * @param contactInfo The contactInfo to set. | |
75 | */ | |
76 | public void setContactInfo(String contactInfo) { | |
77 | 0 | this.contactInfo = contactInfo; |
78 | 0 | } |
79 | ||
80 | /** | |
81 | * Gets the description attribute. | |
82 | * @return Returns the description. | |
83 | */ | |
84 | public String getDescription() { | |
85 | 0 | return description; |
86 | } | |
87 | ||
88 | /** | |
89 | * Sets the description attribute value. | |
90 | * @param description The description to set. | |
91 | */ | |
92 | public void setDescription(String description) { | |
93 | 0 | this.description = description; |
94 | 0 | } |
95 | ||
96 | /** | |
97 | * Gets the id attribute. | |
98 | * @return Returns the id. | |
99 | */ | |
100 | public Long getId() { | |
101 | 0 | return id; |
102 | } | |
103 | ||
104 | /** | |
105 | * Sets the id attribute value. | |
106 | * @param id The id to set. | |
107 | */ | |
108 | public void setId(Long id) { | |
109 | 0 | this.id = id; |
110 | 0 | } |
111 | ||
112 | /** | |
113 | * Gets the name attribute. | |
114 | * @return Returns the name. | |
115 | */ | |
116 | public String getName() { | |
117 | 0 | return name; |
118 | } | |
119 | ||
120 | /** | |
121 | * Sets the name attribute value. | |
122 | * @param name The name to set. | |
123 | */ | |
124 | public void setName(String name) { | |
125 | 0 | this.name = name; |
126 | 0 | } |
127 | ||
128 | /** | |
129 | * Gets the channels attribute. | |
130 | * @return Returns the channels. | |
131 | */ | |
132 | public List<NotificationChannel> getChannels() { | |
133 | 0 | return channels; |
134 | } | |
135 | ||
136 | /** | |
137 | * Sets the channels attribute value. | |
138 | * @param channels The channels to set. | |
139 | */ | |
140 | public void setChannels(List<NotificationChannel> channels) { | |
141 | 0 | this.channels = channels; |
142 | 0 | } |
143 | ||
144 | public String toString() { | |
145 | 0 | return new ToStringBuilder(this).append("id", id) |
146 | .append("name", name) | |
147 | .append("description", description) | |
148 | .append("contactInfo", contactInfo) | |
149 | .toString(); | |
150 | } | |
151 | } |