1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.impl.namespace; |
17 | |
|
18 | |
|
19 | |
import javax.persistence.Column |
20 | |
import javax.persistence.Entity |
21 | |
import javax.persistence.Id |
22 | |
import javax.persistence.Table |
23 | |
import org.hibernate.annotations.Type |
24 | |
import org.kuali.rice.core.api.namespace.Namespace |
25 | |
import org.kuali.rice.core.api.namespace.NamespaceContract |
26 | |
|
27 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
28 | |
import org.kuali.rice.core.api.mo.common.active.MutableInactivatable |
29 | |
|
30 | |
@Entity |
31 | |
@Table(name="KRCR_NMSPC_T") |
32 | |
class NamespaceBo extends PersistableBusinessObjectBase implements NamespaceContract, MutableInactivatable { |
33 | |
|
34 | |
private static final long serialVersionUID = 1L; |
35 | |
|
36 | |
@Column(name="APPL_ID") |
37 | |
def String applicationId; |
38 | |
|
39 | |
@Id |
40 | |
@Column(name="NMSPC_CD") |
41 | |
def String code; |
42 | |
|
43 | |
@Column(name="NM") |
44 | |
def String name; |
45 | |
|
46 | |
@Type(type="yes_no") |
47 | |
@Column(name="ACTV_IND") |
48 | |
def boolean active; |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
static Namespace to(NamespaceBo bo) { |
56 | 0 | if (bo == null) { |
57 | 0 | return null |
58 | |
} |
59 | |
|
60 | 0 | return Namespace.Builder.create(bo).build(); |
61 | |
} |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
static NamespaceBo from(Namespace im) { |
69 | 0 | if (im == null) { |
70 | 0 | return null |
71 | |
} |
72 | |
|
73 | 0 | NamespaceBo bo = new NamespaceBo() |
74 | 0 | bo.applicationId = im.applicationId |
75 | 0 | bo.active = im.active |
76 | 0 | bo.code = im.code |
77 | 0 | bo.name = im.name |
78 | 0 | bo.versionNumber = im.versionNumber |
79 | 0 | bo.objectId = im.objectId |
80 | |
|
81 | 0 | return bo |
82 | |
} |
83 | |
} |
84 | |
|