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