1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.bo.ui;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.kim.impl.identity.phone.EntityPhoneTypeBo;
20
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.FetchType;
24 import javax.persistence.GeneratedValue;
25 import javax.persistence.Id;
26 import javax.persistence.IdClass;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.ManyToOne;
29 import javax.persistence.Table;
30
31
32
33
34
35
36
37 @IdClass(PersonDocumentPhoneId.class)
38 @Entity
39 @Table(name = "KRIM_PND_PHONE_MT")
40 public class PersonDocumentPhone extends PersonDocumentBoDefaultBase {
41 @Id
42 @GeneratedValue(generator="KRIM_ENTITY_PHONE_ID_S")
43 @Column(name = "ENTITY_PHONE_ID")
44 protected String entityPhoneId;
45
46 @Column(name = "ENT_TYP_CD")
47 protected String entityTypeCode;
48
49 @Column(name = "PHONE_TYP_CD")
50 protected String phoneTypeCode;
51
52 @Column(name = "PHONE_NBR")
53 protected String phoneNumber;
54
55 @Column(name = "PHONE_EXTN_NBR")
56 protected String extensionNumber;
57
58 @Column(name = "POSTAL_CNTRY_CD")
59 protected String countryCode;
60
61 @ManyToOne(targetEntity=EntityPhoneTypeBo.class, fetch = FetchType.EAGER, cascade = {})
62 @JoinColumn(name = "PHONE_TYP_CD", insertable = false, updatable = false)
63 protected EntityPhoneTypeBo phoneType;
64
65
66
67 public PersonDocumentPhone() {
68 this.active = true;
69 }
70
71
72
73
74 public String getCountryCode() {
75 return countryCode;
76 }
77
78
79
80
81 public String getEntityPhoneId() {
82 return entityPhoneId;
83 }
84
85
86
87
88 public String getExtensionNumber() {
89 return extensionNumber;
90 }
91
92
93
94
95 public String getPhoneNumber() {
96 return phoneNumber;
97 }
98
99
100
101
102 public String getPhoneTypeCode() {
103 return phoneTypeCode;
104 }
105
106
107
108
109 public void setCountryCode(String countryCode) {
110 this.countryCode = countryCode;
111 }
112
113
114
115
116 public void setExtensionNumber(String extensionNumber) {
117 this.extensionNumber = extensionNumber;
118 }
119
120
121
122
123 public void setPhoneNumber(String phoneNumber) {
124 this.phoneNumber = phoneNumber;
125 }
126
127
128
129
130 public void setPhoneTypeCode(String phoneTypeCode) {
131 this.phoneTypeCode = phoneTypeCode;
132 }
133
134
135
136
137 public String getEntityTypeCode() {
138 return entityTypeCode;
139 }
140
141
142
143
144 public void setEntityTypeCode(String entityTypeCode) {
145 this.entityTypeCode = entityTypeCode;
146 }
147
148 public EntityPhoneTypeBo getPhoneType() {
149 return this.phoneType;
150 }
151
152 public void setPhoneType(EntityPhoneTypeBo phoneType) {
153 this.phoneType = phoneType;
154 }
155
156 public void setEntityPhoneId(String entityPhoneId) {
157 this.entityPhoneId = entityPhoneId;
158 }
159
160 public String getFormattedPhoneNumber() {
161 StringBuffer sb = new StringBuffer( 30 );
162
163
164
165 sb.append( getPhoneNumber() );
166 if ( StringUtils.isNotBlank( getExtensionNumber() ) ) {
167 sb.append( " x" );
168 sb.append( getExtensionNumber() );
169 }
170
171 return sb.toString();
172 }
173
174 }