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