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