1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.impl.identity.privacy |
17 | |
|
18 | |
import javax.persistence.Entity |
19 | |
import javax.persistence.Table |
20 | |
import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferencesContract |
21 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
22 | |
import javax.persistence.Column |
23 | |
import javax.persistence.Id |
24 | |
import org.hibernate.annotations.Type |
25 | |
|
26 | |
import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences |
27 | |
|
28 | |
@Entity |
29 | |
@Table(name = "KRIM_ENTITY_PRIV_PREF_T") |
30 | |
class EntityPrivacyPreferencesBo extends PersistableBusinessObjectBase implements EntityPrivacyPreferencesContract { |
31 | |
private static final long serialVersionUID = 1L; |
32 | |
|
33 | |
@Id |
34 | |
@Column(name = "ENTITY_ID") |
35 | |
String entityId; |
36 | |
|
37 | |
@Type(type="yes_no") |
38 | |
@Column(name="SUPPRESS_NM_IND") |
39 | |
boolean suppressName; |
40 | |
|
41 | |
@Type(type="yes_no") |
42 | |
@Column(name="SUPPRESS_EMAIL_IND") |
43 | |
boolean suppressEmail; |
44 | |
|
45 | |
@Type(type="yes_no") |
46 | |
@Column(name="SUPPRESS_ADDR_IND") |
47 | |
boolean suppressAddress; |
48 | |
|
49 | |
@Type(type="yes_no") |
50 | |
@Column(name="SUPPRESS_PHONE_IND") |
51 | |
boolean suppressPhone; |
52 | |
|
53 | |
@Type(type="yes_no") |
54 | |
@Column(name="SUPPRESS_PRSNL_IND") |
55 | |
boolean suppressPersonal; |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
static EntityPrivacyPreferences to(EntityPrivacyPreferencesBo bo) { |
63 | 0 | if (bo == null) { return null } |
64 | 0 | return EntityPrivacyPreferences.Builder.create(bo).build() |
65 | |
} |
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
static EntityPrivacyPreferencesBo from(EntityPrivacyPreferences immutable) { |
73 | 0 | if (immutable == null) {return null} |
74 | |
|
75 | 0 | EntityPrivacyPreferencesBo bo = new EntityPrivacyPreferencesBo() |
76 | |
|
77 | 0 | bo.entityId = immutable.entityId |
78 | 0 | bo.suppressAddress = immutable.suppressAddress |
79 | 0 | bo.suppressEmail = immutable.suppressEmail |
80 | 0 | bo.suppressName = immutable.suppressName |
81 | 0 | bo.suppressPersonal = immutable.suppressPersonal |
82 | 0 | bo.suppressPhone = immutable.suppressPhone |
83 | 0 | bo.versionNumber = immutable.versionNumber |
84 | 0 | bo.objectId = immutable.objectId |
85 | |
|
86 | 0 | return bo; |
87 | |
} |
88 | |
|
89 | |
} |