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.hibernate.annotations.Parameter;
19 import org.kuali.rice.core.api.mo.ModelObjectBasic;
20 import org.kuali.rice.ksb.api.registry.ServiceDescriptor;
21 import org.kuali.rice.ksb.api.registry.ServiceDescriptorContract;
22
23
24
25
26
27
28
29 @javax.persistence.Entity
30 @javax.persistence.Table(name="KRSB_SVC_DSCRPTR_T")
31 public class ServiceDescriptorBo implements ServiceDescriptorContract, ModelObjectBasic {
32
33 @javax.persistence.Id
34 @javax.persistence.GeneratedValue(generator="KRSB_SVC_DSCRPTR_S")
35 @org.hibernate.annotations.GenericGenerator(name="KRSB_FLT_SVC_DEF_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
36 @Parameter(name="sequence_name", value="KRSB_SVC_DSCRPTR_S"),
37 @Parameter(name="value_column", value="id")
38 })
39 @javax.persistence.Column(name="SVC_DSCRPTR_ID")
40 private String id;
41
42 @javax.persistence.Lob
43 @javax.persistence.Column(name="DSCRPTR", length=4000)
44 private String descriptor;
45
46 @javax.persistence.Version
47 @javax.persistence.Column(name="VER_NBR")
48 private Long versionNumber;
49
50 public String getId() {
51 return id;
52 }
53
54 public void setId(String id) {
55 this.id = id;
56 }
57
58 public String getDescriptor() {
59 return descriptor;
60 }
61
62 public void setDescriptor(String descriptor) {
63 this.descriptor = descriptor;
64 }
65
66 public Long getVersionNumber() {
67 return versionNumber;
68 }
69
70 public void setVersionNumber(Long versionNumber) {
71 this.versionNumber = versionNumber;
72 }
73
74 public static ServiceDescriptor to(ServiceDescriptorBo bo) {
75 if (bo == null) {
76 return null;
77 }
78 return ServiceDescriptor.Builder.create(bo).build();
79 }
80
81 public static ServiceDescriptorBo from(ServiceDescriptor im) {
82 if (im == null) {
83 return null;
84 }
85
86 ServiceDescriptorBo bo = new ServiceDescriptorBo();
87 bo.id = im.getId();
88 bo.descriptor = im.getDescriptor();
89 bo.versionNumber = im.getVersionNumber();
90
91 return bo;
92 }
93
94 }