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 java.util.ArrayList;
19 import java.util.LinkedHashMap;
20
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.FetchType;
24 import javax.persistence.Id;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.ManyToOne;
27 import javax.persistence.Table;
28
29 import org.kuali.rice.kim.bo.reference.EntityNameType;
30 import org.kuali.rice.kim.bo.reference.impl.EntityNameTypeImpl;
31 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
32
33
34
35
36
37
38
39 @Entity
40 @Table(name = "KRIM_PND_NM_T")
41 public class PersonDocumentName extends PersonDocumentBoDefaultBase {
42
43 @Id
44 @Column(name = "ENTITY_NM_ID")
45 protected String entityNameId;
46
47 @Column(name = "ENTITY_ID")
48 protected String entityId;
49
50 @Column(name = "NM_TYP_CD")
51 protected String nameTypeCode ;
52
53 @Column(name = "FIRST_NM")
54 protected String firstName;
55
56 @Column(name = "MIDDLE_NM")
57 protected String middleName;
58
59 @Column(name = "LAST_NM")
60 protected String lastName;
61
62 @Column(name = "TITLE_NM")
63 protected String title;
64
65 @Column(name = "SUFFIX_NM")
66 protected String suffix;
67
68 @ManyToOne(targetEntity=EntityNameTypeImpl.class, fetch = FetchType.EAGER, cascade = {})
69 @JoinColumn(name = "NM_TYP_CD", insertable = false, updatable = false)
70 protected EntityNameType entityNameType;
71
72 public PersonDocumentName() {
73 this.active = true;
74 }
75
76
77
78
79 public String getEntityNameId() {
80 return entityNameId;
81 }
82
83
84
85
86 public String getFirstName() {
87 return firstName;
88 }
89
90
91
92
93 public String getLastName() {
94 return lastName;
95 }
96
97
98
99
100 public String getMiddleName() {
101 return middleName;
102 }
103
104
105
106
107 public String getNameTypeCode() {
108 return nameTypeCode;
109 }
110
111
112
113
114 public String getSuffix() {
115 return suffix;
116 }
117
118
119
120
121 public String getTitle() {
122 return title;
123 }
124
125 public void setFirstName(String firstName) {
126 this.firstName = firstName;
127 }
128
129 public void setLastName(String lastName) {
130 this.lastName = lastName;
131 }
132
133 public void setMiddleName(String middleName) {
134 this.middleName = middleName;
135 }
136
137 public void setNameTypeCode(String nameTypeCode) {
138 this.nameTypeCode = nameTypeCode;
139 }
140
141 public void setSuffix(String suffix) {
142 this.suffix = suffix;
143 }
144
145 public void setTitle(String title) {
146 this.title = title;
147 }
148
149
150
151
152
153
154 public String getFormattedName() {
155 return getLastName() + ", " + getFirstName() + " " + getMiddleName();
156 }
157
158
159
160
161 @SuppressWarnings("unchecked")
162 @Override
163 protected LinkedHashMap toStringMapper() {
164 LinkedHashMap m = super.toStringMapper();
165 m.put( "entityNameId", entityNameId );
166 m.put( "firstName", firstName );
167 m.put( "lastName", lastName );
168 return m;
169 }
170
171 public String getEntityId() {
172 return this.entityId;
173 }
174
175 public void setEntityId(String entityId) {
176 this.entityId = entityId;
177 }
178
179 public EntityNameType getEntityNameType() {
180 return this.entityNameType;
181 }
182
183 public void setEntityNameType(EntityNameType entityNameType) {
184 this.entityNameType = entityNameType;
185 }
186
187 public void setEntityNameId(String entityNameId) {
188 this.entityNameId = entityNameId;
189 }
190
191 @Override
192 public boolean isActive(){
193 return this.active;
194 }
195 }