1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.impl.registry;
17
18 import org.kuali.rice.core.api.mo.ModelObjectBasic;
19 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
20 import org.kuali.rice.ksb.api.registry.ServiceDescriptor;
21 import org.kuali.rice.ksb.api.registry.ServiceDescriptorContract;
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.Lob;
28 import javax.persistence.Table;
29
30 @Entity
31 @Table(name="KRSB_SVC_DSCRPTR_T")
32 public class ServiceDescriptorBo implements ServiceDescriptorContract, ModelObjectBasic {
33
34 @Id
35 @GeneratedValue(generator = "KRSB_SVC_DSCRPTR_S")
36 @PortableSequenceGenerator(name = "KRSB_SVC_DSCRPTR_S")
37 @Column(name="SVC_DSCRPTR_ID")
38 private String id;
39
40 @Lob
41 @Column(name="DSCRPTR", length = 4000)
42 private String descriptor;
43
44 public String getId() {
45 return id;
46 }
47
48 public void setId(String id) {
49 this.id = id;
50 }
51
52 public String getDescriptor() {
53 return descriptor;
54 }
55
56 public void setDescriptor(String descriptor) {
57 this.descriptor = descriptor;
58 }
59
60 @Override
61 public Long getVersionNumber() {
62 return null;
63 }
64
65 public static ServiceDescriptor to(ServiceDescriptorBo bo) {
66 if (bo == null) {
67 return null;
68 }
69 return ServiceDescriptor.Builder.create(bo).build();
70 }
71
72 public static ServiceDescriptorBo from(ServiceDescriptor im) {
73 if (im == null) {
74 return null;
75 }
76
77 ServiceDescriptorBo bo = new ServiceDescriptorBo();
78 bo.id = im.getId();
79 bo.descriptor = im.getDescriptor();
80
81 return bo;
82 }
83
84 }