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