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.core.api.mo.common.Versioned;
19 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
20 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
21 import org.kuali.rice.krms.api.repository.reference.ReferenceObjectBinding;
22 import org.kuali.rice.krms.api.repository.reference.ReferenceObjectBindingContract;
23
24 import javax.persistence.Column;
25 import javax.persistence.Convert;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.Id;
29 import javax.persistence.Table;
30 import javax.persistence.Version;
31 import java.io.Serializable;
32
33
34
35
36
37
38 @Entity
39 @Table(name = "KRMS_REF_OBJ_KRMS_OBJ_T")
40 public class ReferenceObjectBindingBo implements ReferenceObjectBindingContract, Versioned, Serializable {
41
42 private static final long serialVersionUID = 1l;
43
44 @PortableSequenceGenerator(name = "KRMS_REF_OBJ_KRMS_OBJ_S")
45 @GeneratedValue(generator = "KRMS_REF_OBJ_KRMS_OBJ_S")
46 @Id
47 @Column(name = "REF_OBJ_KRMS_OBJ_ID")
48 private String id;
49
50 @Column(name = "COLLECTION_NM")
51 private String collectionName;
52
53 @Column(name = "KRMS_DSCR_TYP")
54 private String krmsDiscriminatorType;
55
56 @Column(name = "KRMS_OBJ_ID")
57 private String krmsObjectId;
58
59 @Column(name = "NMSPC_CD")
60 private String namespace;
61
62 @Column(name = "REF_DSCR_TYP")
63 private String referenceDiscriminatorType;
64
65 @Column(name = "REF_OBJ_ID")
66 private String referenceObjectId;
67
68 @Column(name = "ACTV")
69 @Convert(converter = BooleanYNConverter.class)
70 private boolean active;
71
72 @Column(name = "VER_NBR")
73 @Version
74 private Long versionNumber;
75
76
77
78
79
80 public ReferenceObjectBindingBo() {
81 }
82
83 @Override
84 public String getCollectionName() {
85 return this.collectionName;
86 }
87
88 @Override
89 public String getKrmsDiscriminatorType() {
90 return this.krmsDiscriminatorType;
91 }
92
93 @Override
94 public String getKrmsObjectId() {
95 return this.krmsObjectId;
96 }
97
98 @Override
99 public String getNamespace() {
100 return this.namespace;
101 }
102
103 @Override
104 public String getReferenceDiscriminatorType() {
105 return this.referenceDiscriminatorType;
106 }
107
108 @Override
109 public String getReferenceObjectId() {
110 return this.referenceObjectId;
111 }
112
113 @Override
114 public String getId() {
115 return this.id;
116 }
117
118 @Override
119 public boolean isActive() {
120 return this.active;
121 }
122
123 @Override
124 public Long getVersionNumber() {
125 return this.versionNumber;
126 }
127
128
129
130
131
132
133
134 public void setCollectionName(String collectionName) {
135 this.collectionName = collectionName;
136 }
137
138
139
140
141
142
143
144 public void setKrmsDiscriminatorType(String krmsDiscriminatorType) {
145 this.krmsDiscriminatorType = krmsDiscriminatorType;
146 }
147
148
149
150
151
152
153
154 public void setKrmsObjectId(String krmsObjectId) {
155 this.krmsObjectId = krmsObjectId;
156 }
157
158
159
160
161
162
163
164 public void setNamespace(String namespace) {
165 this.namespace = namespace;
166 }
167
168
169
170
171
172
173
174 public void setReferenceDiscriminatorType(String referenceDiscriminatorType) {
175 this.referenceDiscriminatorType = referenceDiscriminatorType;
176 }
177
178
179
180
181
182
183
184 public void setReferenceObjectId(String referenceObjectId) {
185 this.referenceObjectId = referenceObjectId;
186 }
187
188
189
190
191
192
193
194 public void setId(String id) {
195 this.id = id;
196 }
197
198
199
200
201
202
203
204 public void setActive(boolean active) {
205 this.active = active;
206 }
207
208
209
210
211
212
213
214 public void setVersionNumber(Long versionNumber) {
215 this.versionNumber = versionNumber;
216 }
217
218
219
220
221
222
223
224 public static ReferenceObjectBinding to(ReferenceObjectBindingBo referenceObjectBindingBo) {
225 if (referenceObjectBindingBo == null) {
226 return null;
227 }
228
229 return ReferenceObjectBinding.Builder.create(referenceObjectBindingBo).build();
230 }
231
232
233
234
235
236
237
238 public static org.kuali.rice.krms.impl.repository.ReferenceObjectBindingBo from(ReferenceObjectBinding referenceObjectBinding) {
239 if (referenceObjectBinding == null) {
240 return null;
241 }
242
243 ReferenceObjectBindingBo referenceObjectBindingBo = new ReferenceObjectBindingBo();
244 referenceObjectBindingBo.setCollectionName(referenceObjectBinding.getCollectionName());
245 referenceObjectBindingBo.setKrmsDiscriminatorType(referenceObjectBinding.getKrmsDiscriminatorType());
246 referenceObjectBindingBo.setKrmsObjectId(referenceObjectBinding.getKrmsObjectId());
247 referenceObjectBindingBo.setNamespace(referenceObjectBinding.getNamespace());
248 referenceObjectBindingBo.setReferenceDiscriminatorType(referenceObjectBinding.getReferenceDiscriminatorType());
249 referenceObjectBindingBo.setReferenceObjectId(referenceObjectBinding.getReferenceObjectId());
250 referenceObjectBindingBo.setId(referenceObjectBinding.getId());
251 referenceObjectBindingBo.setActive(referenceObjectBinding.isActive());
252 referenceObjectBindingBo.setVersionNumber(referenceObjectBinding.getVersionNumber());
253
254 return referenceObjectBindingBo;
255 }
256 }