1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.impl.repository;
17
18 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
19 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
20 import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage;
21 import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsageContract;
22
23 import javax.persistence.Column;
24 import javax.persistence.Convert;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.Id;
28 import javax.persistence.Table;
29 import javax.persistence.Version;
30 import java.io.Serializable;
31
32
33
34
35
36
37 @Entity
38 @Table(name = "KRMS_NL_USAGE_T")
39 public class NaturalLanguageUsageBo implements NaturalLanguageUsageContract, Serializable {
40
41 private static final long serialVersionUID = 1l;
42
43 @PortableSequenceGenerator(name = "KRMS_NL_USAGE_S")
44 @GeneratedValue(generator = "KRMS_NL_USAGE_S")
45 @Id
46 @Column(name = "NL_USAGE_ID")
47 private String id;
48
49 @Column(name = "NM")
50 private String name;
51
52 @Column(name = "DESC_TXT")
53 private String description;
54
55 @Column(name = "NMSPC_CD")
56 private String namespace;
57
58 @Column(name = "ACTV")
59 @Convert(converter = BooleanYNConverter.class)
60 private boolean active;
61
62 @Column(name = "VER_NBR")
63 @Version
64 private Long versionNumber;
65
66
67
68
69
70 public NaturalLanguageUsageBo() {
71 }
72
73 @Override
74 public String getName() {
75 return this.name;
76 }
77
78 @Override
79 public String getDescription() {
80 return this.description;
81 }
82
83 @Override
84 public String getNamespace() {
85 return this.namespace;
86 }
87
88 @Override
89 public String getId() {
90 return this.id;
91 }
92
93 @Override
94 public boolean isActive() {
95 return this.active;
96 }
97
98 @Override
99 public Long getVersionNumber() {
100 return this.versionNumber;
101 }
102
103
104
105
106
107
108
109 public void setName(String name) {
110 this.name = name;
111 }
112
113
114
115
116
117
118
119 public void setDescription(String description) {
120 this.description = description;
121 }
122
123
124
125
126
127
128
129 public void setNamespace(String namespace) {
130 this.namespace = namespace;
131 }
132
133
134
135
136
137
138
139 public void setId(String id) {
140 this.id = id;
141 }
142
143
144
145
146
147
148
149 public void setActive(boolean active) {
150 this.active = active;
151 }
152
153
154
155
156
157
158
159 public void setVersionNumber(Long versionNumber) {
160 this.versionNumber = versionNumber;
161 }
162
163
164
165
166
167
168
169 public static NaturalLanguageUsage to(NaturalLanguageUsageBo naturalLanguageUsageBo) {
170 if (naturalLanguageUsageBo == null) {
171 return null;
172 }
173
174 return NaturalLanguageUsage.Builder.create(naturalLanguageUsageBo).build();
175 }
176
177
178
179
180
181
182
183 public static org.kuali.rice.krms.impl.repository.NaturalLanguageUsageBo from(NaturalLanguageUsage naturalLanguageUsage) {
184 if (naturalLanguageUsage == null) {
185 return null;
186 }
187
188 NaturalLanguageUsageBo naturalLanguageUsageBo = new NaturalLanguageUsageBo();
189 naturalLanguageUsageBo.setName(naturalLanguageUsage.getName());
190 naturalLanguageUsageBo.setDescription(naturalLanguageUsage.getDescription());
191 naturalLanguageUsageBo.setNamespace(naturalLanguageUsage.getNamespace());
192 naturalLanguageUsageBo.setId(naturalLanguageUsage.getId());
193 naturalLanguageUsageBo.setActive(naturalLanguageUsage.isActive());
194 naturalLanguageUsageBo.setVersionNumber(naturalLanguageUsage.getVersionNumber());
195
196 return naturalLanguageUsageBo;
197 }
198 }