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 | |
import org.kuali.rice.kns.bo.Inactivateable |
27 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase |
28 | |
|
29 | |
@Entity |
30 | |
@Table(name="KRNS_NMSPC_T") |
31 | |
class NamespaceBo extends PersistableBusinessObjectBase implements NamespaceContract, Inactivateable { |
32 | |
|
33 | |
private static final long serialVersionUID = 1L; |
34 | |
|
35 | |
@Column(name="APPL_NMSPC_CD") |
36 | |
def String applicationCode; |
37 | |
|
38 | |
@Id |
39 | |
@Column(name="NMSPC_CD") |
40 | |
def String code; |
41 | |
|
42 | |
@Column(name="NM") |
43 | |
def String name; |
44 | |
|
45 | |
@Type(type="yes_no") |
46 | |
@Column(name="ACTV_IND") |
47 | |
def boolean active; |
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
static Namespace to(NamespaceBo bo) { |
55 | 0 | if (bo == null) { |
56 | 0 | return null |
57 | |
} |
58 | |
|
59 | 0 | return Namespace.Builder.create(bo).build(); |
60 | |
} |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
static NamespaceBo from(Namespace im) { |
68 | 0 | if (im == null) { |
69 | 0 | return null |
70 | |
} |
71 | |
|
72 | 0 | NamespaceBo bo = new NamespaceBo() |
73 | 0 | bo.applicationCode = im.applicationCode |
74 | 0 | bo.active = im.active |
75 | 0 | bo.code = im.code |
76 | 0 | bo.name = im.name |
77 | 0 | bo.versionNumber = im.versionNumber |
78 | 0 | bo.objectId = im.objectId |
79 | |
|
80 | 0 | return bo |
81 | |
} |
82 | |
} |
83 | |
|