1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.impl.component; |
17 | |
|
18 | |
|
19 | |
import javax.persistence.Column |
20 | |
import javax.persistence.Entity |
21 | |
import javax.persistence.Id |
22 | |
import javax.persistence.IdClass |
23 | |
import javax.persistence.Table |
24 | |
import org.kuali.rice.core.api.component.Component |
25 | |
import org.kuali.rice.core.api.component.ComponentContract |
26 | |
import org.kuali.rice.krad.bo.BusinessObject |
27 | |
import org.kuali.rice.krad.bo.PersistableBusinessObject |
28 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
29 | |
|
30 | |
@IdClass(ComponentId.class) |
31 | |
@Entity |
32 | |
@Table(name="KRCR_DRVD_CMPNT_T") |
33 | |
public class DerivedComponentBo extends PersistableBusinessObjectBase implements ComponentContract { |
34 | |
|
35 | |
@Id |
36 | |
@Column(name="NMSPC_CD") |
37 | |
String namespaceCode |
38 | |
|
39 | |
@Id |
40 | |
@Column(name="CMPNT_CD") |
41 | |
String code |
42 | |
|
43 | |
@Column(name="NM") |
44 | |
String name |
45 | |
|
46 | |
@Column(name="CMPNT_SET_ID") |
47 | |
String componentSetId |
48 | |
|
49 | |
@Override |
50 | |
String getObjectId() { |
51 | 0 | return null |
52 | |
} |
53 | |
|
54 | |
@Override |
55 | |
boolean isActive() { |
56 | 0 | return true |
57 | |
} |
58 | |
|
59 | |
@Override |
60 | |
Long getVersionNumber() { |
61 | 0 | return null |
62 | |
} |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
static Component to(DerivedComponentBo bo) { |
70 | 0 | if (bo == null) { |
71 | 0 | return null |
72 | |
} |
73 | 0 | return Component.Builder.create(bo).build() |
74 | |
} |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
static DerivedComponentBo from(Component im) { |
82 | 0 | if (im == null) { |
83 | 0 | return null |
84 | |
} |
85 | |
|
86 | 0 | DerivedComponentBo bo = new DerivedComponentBo() |
87 | 0 | bo.code = im.code |
88 | 0 | bo.name = im.name |
89 | 0 | bo.namespaceCode = im.namespaceCode |
90 | 0 | bo.componentSetId = im.componentSetId |
91 | |
|
92 | 0 | return bo |
93 | |
} |
94 | |
|
95 | |
static ComponentBo toComponentBo(DerivedComponentBo derivedComponentBo) { |
96 | 0 | if (derivedComponentBo == null) { |
97 | 0 | return null |
98 | |
} |
99 | 0 | Component component = DerivedComponentBo.to(derivedComponentBo); |
100 | 0 | return ComponentBo.from(component); |
101 | |
} |
102 | |
} |
103 | |
|