| 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 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 | |
|
| 35 | |
|
| 36 | |
|
| 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 | |
|
| 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 | |
|
| 59 | |
|
| 60 | 0 | public NotificationProducer() { |
| 61 | 0 | channels = new ArrayList<NotificationChannel>(); |
| 62 | 0 | } |
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
public String getContactInfo() { |
| 69 | 0 | return contactInfo; |
| 70 | |
} |
| 71 | |
|
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
public void setContactInfo(String contactInfo) { |
| 77 | 0 | this.contactInfo = contactInfo; |
| 78 | 0 | } |
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
public String getDescription() { |
| 85 | 0 | return description; |
| 86 | |
} |
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
public void setDescription(String description) { |
| 93 | 0 | this.description = description; |
| 94 | 0 | } |
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
public Long getId() { |
| 101 | 0 | return id; |
| 102 | |
} |
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
public void setId(Long id) { |
| 109 | 0 | this.id = id; |
| 110 | 0 | } |
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
public String getName() { |
| 117 | 0 | return name; |
| 118 | |
} |
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
public void setName(String name) { |
| 125 | 0 | this.name = name; |
| 126 | 0 | } |
| 127 | |
|
| 128 | |
|
| 129 | |
|
| 130 | |
|
| 131 | |
|
| 132 | |
public List<NotificationChannel> getChannels() { |
| 133 | 0 | return channels; |
| 134 | |
} |
| 135 | |
|
| 136 | |
|
| 137 | |
|
| 138 | |
|
| 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 | |
} |