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 | |
import org.hibernate.annotations.Type |
24 | |
import org.kuali.rice.krad.bo.MutableInactivatable |
25 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
26 | |
import org.kuali.rice.shareddata.api.campus.CampusType |
27 | |
import org.kuali.rice.shareddata.api.campus.CampusTypeContract |
28 | |
|
29 | |
@Entity |
30 | |
@Table(name="KRLC_CMP_TYP_T") |
31 | |
public class CampusTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, CampusTypeContract { |
32 | |
@Id |
33 | |
@Column(name="CAMPUS_TYP_CD") |
34 | |
def String code; |
35 | |
|
36 | |
@Column(name="CMP_TYP_NM") |
37 | |
def String name; |
38 | |
|
39 | |
@Type(type="yes_no") |
40 | |
@Column(name="ACTV_IND") |
41 | |
def boolean active; |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
static CampusType to(CampusTypeBo bo) { |
49 | 5 | if (bo == null) { return null } |
50 | 4 | return CampusType.Builder.create(bo).build() |
51 | |
} |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
static CampusTypeBo from(CampusType im) { |
59 | 1 | if (im == null) {return null} |
60 | |
|
61 | 0 | CampusTypeBo bo = new CampusTypeBo() |
62 | 0 | bo.code = im.code |
63 | 0 | bo.name = im.name |
64 | 0 | bo.active = im.active |
65 | 0 | bo.versionNumber = im.versionNumber |
66 | 0 | bo.objectId = im.objectId |
67 | |
|
68 | 0 | return bo; |
69 | |
} |
70 | |
} |