Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
UserChannelSubscription |
|
| 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.ken.bo; | |
17 | ||
18 | import javax.persistence.JoinColumn; | |
19 | import javax.persistence.FetchType; | |
20 | import javax.persistence.OneToOne; | |
21 | import javax.persistence.Column; | |
22 | import javax.persistence.Id; | |
23 | import javax.persistence.CascadeType; | |
24 | import javax.persistence.Table; | |
25 | import javax.persistence.Entity; | |
26 | ||
27 | /** | |
28 | * This class represents an instance of a user's subscription to a specific | |
29 | * notification channel. | |
30 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
31 | */ | |
32 | @Entity | |
33 | @Table(name="KREN_CHNL_SUBSCRP_T") | |
34 | public class UserChannelSubscription { | |
35 | @Id | |
36 | @Column(name="CHNL_SUBSCRP_ID") | |
37 | private Long id; | |
38 | @Column(name="PRNCPL_ID", nullable=false) | |
39 | private String userId; | |
40 | ||
41 | @OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST}) | |
42 | @JoinColumn(name="CHNL_ID") | |
43 | private NotificationChannel channel; | |
44 | ||
45 | /** | |
46 | * Constructs a UserChannelSubscription instance. | |
47 | */ | |
48 | 0 | public UserChannelSubscription() { |
49 | 0 | } |
50 | ||
51 | /** | |
52 | * Gets the channel attribute. | |
53 | * @return Returns the channel. | |
54 | */ | |
55 | public NotificationChannel getChannel() { | |
56 | 0 | return channel; |
57 | } | |
58 | ||
59 | /** | |
60 | * Sets the channel attribute value. | |
61 | * @param channel The channel to set. | |
62 | */ | |
63 | public void setChannel(NotificationChannel channel) { | |
64 | 0 | this.channel = channel; |
65 | 0 | } |
66 | ||
67 | /** | |
68 | * Gets the id attribute. | |
69 | * @return Returns the id. | |
70 | */ | |
71 | public Long getId() { | |
72 | 0 | return id; |
73 | } | |
74 | ||
75 | /** | |
76 | * Sets the id attribute value. | |
77 | * @param id The id to set. | |
78 | */ | |
79 | public void setId(Long id) { | |
80 | 0 | this.id = id; |
81 | 0 | } |
82 | ||
83 | /** | |
84 | * Gets the userId attribute. | |
85 | * @return Returns the userId. | |
86 | */ | |
87 | public String getUserId() { | |
88 | 0 | return userId; |
89 | } | |
90 | ||
91 | /** | |
92 | * Sets the userId attribute value. | |
93 | * @param userId The userId to set. | |
94 | */ | |
95 | public void setUserId(String userId) { | |
96 | 0 | this.userId = userId; |
97 | 0 | } |
98 | } | |
99 |