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.NotificationPriority;
19 import org.kuali.rice.ken.api.notification.NotificationPriorityContract;
20 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
21 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
22
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.Id;
27 import javax.persistence.Table;
28
29
30
31
32
33
34
35
36 @Entity
37 @Table(name="KREN_PRIO_T")
38 public class NotificationPriorityBo extends PersistableBusinessObjectBase implements NotificationPriorityContract {
39 @Id
40 @GeneratedValue(generator="KREN_PRIO_S")
41 @PortableSequenceGenerator(name="KREN_PRIO_S")
42 @Column(name="PRIO_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="PRIO_ORD", nullable=false)
49 private Integer order;
50
51
52
53
54 public NotificationPriorityBo() {
55 }
56
57
58
59
60
61 public String getDescription() {
62 return description;
63 }
64
65
66
67
68
69 public void setDescription(String description) {
70 this.description = description;
71 }
72
73
74
75
76
77 public Long getId() {
78 return id;
79 }
80
81
82
83
84
85 public void setId(Long id) {
86 this.id = id;
87 }
88
89
90
91
92
93 public String getName() {
94 return name;
95 }
96
97
98
99
100
101 public void setName(String name) {
102 this.name = name;
103 }
104
105
106
107
108
109 public Integer getOrder() {
110 return order;
111 }
112
113
114
115
116
117 public void setOrder(Integer order) {
118 this.order = order;
119 }
120
121
122
123
124
125
126 public static NotificationPriority to(NotificationPriorityBo bo) {
127 if (bo == null) {
128 return null;
129 }
130
131 return NotificationPriority.Builder.create(bo).build();
132 }
133
134
135
136
137
138
139 public static NotificationPriorityBo from(NotificationPriority im) {
140 if (im == null) {
141 return null;
142 }
143
144 NotificationPriorityBo bo = new NotificationPriorityBo();
145 bo.setId(im.getId());
146 bo.setVersionNumber(im.getVersionNumber());
147 bo.setObjectId(im.getObjectId());
148 bo.setName(im.getName());
149 bo.setDescription(im.getDescription());
150 bo.setOrder(im.getOrder());
151
152 return bo;
153 }
154 }
155