| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| NotificationMessageDelivery |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 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 org.hibernate.annotations.GenericGenerator; | |
| 19 | import org.hibernate.annotations.Parameter; | |
| 20 | import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; | |
| 21 | ||
| 22 | import javax.persistence.*; | |
| 23 | import java.sql.Timestamp; | |
| 24 | ||
| 25 | /** | |
| 26 | * This class represents and instance of a NotificationMessageDelivery. A Notification gets delivered to | |
| 27 | * recipients, possibly in various ways. For each delivery type that a recipient gets sent to them, | |
| 28 | * they have an instance of this entity. | |
| 29 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 30 | */ | |
| 31 | @Entity | |
| 32 | @Table(name="KREN_NTFCTN_MSG_DELIV_T") | |
| 33 | public class NotificationMessageDelivery extends PersistableBusinessObjectBase implements Lockable { | |
| 34 | @Id | |
| 35 | @GeneratedValue(generator="KREN_NTFCTN_MSG_DELIV_S") | |
| 36 | @GenericGenerator(name="KREN_NTFCTN_MSG_DELIV_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={ | |
| 37 | @Parameter(name="sequence_name",value="KREN_NTFCTN_MSG_DELIV_S"), | |
| 38 | @Parameter(name="value_column",value="id") | |
| 39 | }) | |
| 40 | @Column(name="NTFCTN_MSG_DELIV_ID") | |
| 41 | private Long id; | |
| 42 | @Column(name="STAT_CD", nullable=false) | |
| 43 | private String messageDeliveryStatus; | |
| 44 | @Column(name="RECIP_ID", nullable=false) | |
| 45 | private String userRecipientId; | |
| 46 | @Column(name="SYS_ID", nullable=true) | |
| 47 | private String deliverySystemId; // can hold an identifier from the endpoint delivery mechanism system (i.e. workflow id, SMS id, etc) | |
| 48 | @Column(name="LOCKD_DTTM", nullable=true) | |
| 49 | private Timestamp lockedDate; | |
| 50 | ||
| 51 | /** | |
| 52 | * Lock column for OJB optimistic locking | |
| 53 | */ | |
| 54 | // @Version | |
| 55 | // @Column(name="VER_NBR") | |
| 56 | // private Integer lockVerNbr; | |
| 57 | ||
| 58 | @OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH, CascadeType.DETACH}) | |
| 59 | @JoinColumn(name="NTFCTN_ID") | |
| 60 | private Notification notification; | |
| 61 | ||
| 62 | /** | |
| 63 | * Constructs a NotificationMessageDelivery instance. | |
| 64 | */ | |
| 65 | 0 | public NotificationMessageDelivery() { |
| 66 | 0 | } |
| 67 | ||
| 68 | /** | |
| 69 | * Gets the id attribute. | |
| 70 | * @return Returns the id. | |
| 71 | */ | |
| 72 | public Long getId() { | |
| 73 | 0 | return id; |
| 74 | } | |
| 75 | ||
| 76 | /** | |
| 77 | * Sets the id attribute value. | |
| 78 | * @param id The id to set. | |
| 79 | */ | |
| 80 | public void setId(Long id) { | |
| 81 | 0 | this.id = id; |
| 82 | 0 | } |
| 83 | ||
| 84 | ||
| 85 | /** | |
| 86 | * Return value of lock column for OJB optimistic locking | |
| 87 | * @return value of lock column for OJB optimistic locking | |
| 88 | */ | |
| 89 | //public Integer getLockVerNbr() { | |
| 90 | // return lockVerNbr; | |
| 91 | //return Integer.valueOf(super.getVersionNumber().intValue()); | |
| 92 | //} | |
| 93 | ||
| 94 | /** | |
| 95 | * Set value of lock column for OJB optimistic locking | |
| 96 | * @param lockVerNbr value of lock column for OJB optimistic locking | |
| 97 | */ | |
| 98 | //public void setLockVerNbr(Integer lockVerNbr) { | |
| 99 | // this.lockVerNbr = lockVerNbr; | |
| 100 | // //super.setVersionNumber(lockVerNbr.longValue()); | |
| 101 | //} | |
| 102 | ||
| 103 | /** | |
| 104 | * Gets the messageDeliveryStatus attribute. | |
| 105 | * @return Returns the messageDeliveryStatus. | |
| 106 | */ | |
| 107 | public String getMessageDeliveryStatus() { | |
| 108 | 0 | return messageDeliveryStatus; |
| 109 | } | |
| 110 | ||
| 111 | /** | |
| 112 | * Sets the messageDeliveryStatus attribute value. | |
| 113 | * @param messageDeliveryStatus The messageDeliveryStatus to set. | |
| 114 | */ | |
| 115 | public void setMessageDeliveryStatus(String deliveryStatus) { | |
| 116 | 0 | this.messageDeliveryStatus = deliveryStatus; |
| 117 | 0 | } |
| 118 | ||
| 119 | /** | |
| 120 | * Gets the userRecipientId attribute. | |
| 121 | * @return Returns the userRecipientId. | |
| 122 | */ | |
| 123 | public String getUserRecipientId() { | |
| 124 | 0 | return userRecipientId; |
| 125 | } | |
| 126 | ||
| 127 | /** | |
| 128 | * Sets the userRecipientId attribute value. | |
| 129 | * @param userRecipientId The userRecipientId to set. | |
| 130 | */ | |
| 131 | public void setUserRecipientId(String userRecipientId) { | |
| 132 | 0 | this.userRecipientId = userRecipientId; |
| 133 | 0 | } |
| 134 | ||
| 135 | /** | |
| 136 | * Gets the lockedDate attribute. | |
| 137 | * @return Returns the lockedDate. | |
| 138 | */ | |
| 139 | public Timestamp getLockedDate() { | |
| 140 | 0 | return lockedDate; |
| 141 | } | |
| 142 | ||
| 143 | /** | |
| 144 | * Sets the lockedDate attribute value. | |
| 145 | * @param lockedDate The lockedDate to set. | |
| 146 | */ | |
| 147 | public void setLockedDate(Timestamp lockedDate) { | |
| 148 | 0 | this.lockedDate = lockedDate; |
| 149 | 0 | } |
| 150 | ||
| 151 | /** | |
| 152 | * Gets the notification attribute. | |
| 153 | * @return Returns the notification. | |
| 154 | */ | |
| 155 | public Notification getNotification() { | |
| 156 | 0 | return notification; |
| 157 | } | |
| 158 | ||
| 159 | /** | |
| 160 | * Sets the notification attribute value. | |
| 161 | * @param notification The notification to set. | |
| 162 | */ | |
| 163 | public void setNotification(Notification notification) { | |
| 164 | 0 | this.notification = notification; |
| 165 | 0 | } |
| 166 | ||
| 167 | /** | |
| 168 | * Gets the deliverySystemId attribute. | |
| 169 | * @return Returns the deliverySystemId. | |
| 170 | */ | |
| 171 | public String getDeliverySystemId() { | |
| 172 | 0 | return deliverySystemId; |
| 173 | } | |
| 174 | ||
| 175 | /** | |
| 176 | * Sets the deliverySystemId attribute value. | |
| 177 | * @param deliverySystemId The deliverySystemId to set. | |
| 178 | */ | |
| 179 | public void setDeliverySystemId(String deliverySystemId) { | |
| 180 | 0 | this.deliverySystemId = deliverySystemId; |
| 181 | 0 | } |
| 182 | } |