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 org.kuali.rice.ken.api.notification.NotificationChannelReviewer;
19 import org.kuali.rice.ken.api.notification.NotificationChannelReviewerContract;
20 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
21 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
22
23 import javax.persistence.CascadeType;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.FetchType;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.Id;
29 import javax.persistence.JoinColumn;
30 import javax.persistence.OneToOne;
31 import javax.persistence.Table;
32
33
34
35
36
37 @Entity
38 @Table(name="KREN_RVWER_T")
39 public class NotificationChannelReviewerBo extends PersistableBusinessObjectBase implements NotificationChannelReviewerContract {
40 @Id
41 @GeneratedValue(generator="KREN_RVWER_S")
42 @PortableSequenceGenerator(name="KREN_RVWER_S")
43 @Column(name="RVWER_ID")
44 private Long id;
45 @OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH, CascadeType.DETACH })
46 @JoinColumn(name="CHNL_ID")
47 private NotificationChannelBo channel;
48 @Column(name="TYP", nullable=false)
49 private String reviewerType;
50 @Column(name="PRNCPL_ID", nullable=false)
51 private String reviewerId;
52
53
54
55
56
57 public Long getId() {
58 return id;
59 }
60
61
62
63
64
65 public void setId(Long id) {
66 this.id = id;
67 }
68
69
70
71
72
73 public NotificationChannelBo getChannel() {
74 return channel;
75 }
76
77
78
79
80
81 public void setChannel(NotificationChannelBo channel) {
82 this.channel = channel;
83 }
84
85
86
87
88
89
90 public String getReviewerId() {
91 return reviewerId;
92 }
93
94
95
96
97
98 public void setReviewerId(String reviewerId) {
99 this.reviewerId = reviewerId;
100 }
101
102
103
104
105
106 public String getReviewerType() {
107 return reviewerType;
108 }
109
110
111
112
113
114 public void setReviewerType(String reviewerType) {
115 this.reviewerType = reviewerType;
116 }
117
118
119
120
121
122
123 public static NotificationChannelReviewer to(NotificationChannelReviewerBo bo) {
124 if (bo == null) {
125 return null;
126 }
127
128 return NotificationChannelReviewer.Builder.create(bo).build();
129 }
130
131
132
133
134
135
136 public static NotificationChannelReviewerBo from(NotificationChannelReviewer im) {
137 if (im == null) {
138 return null;
139 }
140
141 NotificationChannelReviewerBo bo = new NotificationChannelReviewerBo();
142 bo.setId(im.getId());
143 bo.setVersionNumber(im.getVersionNumber());
144 bo.setObjectId(im.getObjectId());
145
146 bo.setReviewerType(im.getReviewerType());
147 bo.setReviewerId(im.getReviewerId());
148 bo.setChannel(im.getChannel() == null ? null : NotificationChannelBo.from(im.getChannel()));
149
150 return bo;
151 }
152 }