1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.shareddata.impl.campus |
18 | |
|
19 | |
import javax.persistence.Column |
20 | |
import javax.persistence.Entity |
21 | |
import javax.persistence.Id |
22 | |
import javax.persistence.Table |
23 | |
|
24 | |
import org.hibernate.annotations.Type |
25 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase |
26 | |
import org.kuali.rice.shareddata.api.campus.CampusType |
27 | |
import org.kuali.rice.shareddata.api.campus.CampusTypeContract |
28 | |
import org.kuali.rice.kns.bo.ExternalizableBusinessObject; |
29 | |
import org.kuali.rice.kns.bo.Inactivateable; |
30 | |
import org.kuali.rice.shareddata.api.campus.CampusContract; |
31 | |
|
32 | |
@Entity |
33 | |
@Table(name="KRNS_CMP_TYP_T") |
34 | |
public class CampusTypeBo extends PersistableBusinessObjectBase implements Inactivateable, CampusTypeContract { |
35 | |
@Id |
36 | |
@Column(name="CAMPUS_TYP_CD") |
37 | |
def String code; |
38 | |
|
39 | |
@Column(name="CMP_TYP_NM") |
40 | |
def String name; |
41 | |
|
42 | |
@Type(type="yes_no") |
43 | |
@Column(name="ACTV_IND") |
44 | |
def boolean active; |
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
static CampusType to(CampusTypeBo bo) { |
52 | 5 | if (bo == null) { return null } |
53 | 4 | return CampusType.Builder.create(bo).build() |
54 | |
} |
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
static CampusTypeBo from(CampusType im) { |
62 | 1 | if (im == null) {return null} |
63 | |
|
64 | 0 | CampusTypeBo bo = new CampusTypeBo() |
65 | 0 | bo.code = im.code |
66 | 0 | bo.name = im.name |
67 | 0 | bo.active = im.active |
68 | 0 | bo.versionNumber = im.versionNumber |
69 | 0 | bo.objectId = im.objectId |
70 | |
|
71 | 0 | return bo; |
72 | |
} |
73 | |
} |