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