View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.bo.ui;
17  
18  import java.sql.Timestamp;
19  
20  import javax.persistence.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.Id;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.Table;
28  import javax.persistence.Transient;
29  
30  import org.eclipse.persistence.annotations.JoinFetch;
31  import org.eclipse.persistence.annotations.JoinFetchType;
32  import org.kuali.rice.kim.impl.identity.name.EntityNameTypeBo;
33  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
34  
35  /**
36   * This is a description of what this class does - shyu don't forget to fill this in. 
37   * 
38   * @author Kuali Rice Team (rice.collab@kuali.org)
39   *
40   */
41  @Entity
42  @Table(name = "KRIM_PND_NM_MT")
43  public class PersonDocumentName extends PersonDocumentBoDefaultBase {
44      private static final long serialVersionUID = 1L;
45  
46      @PortableSequenceGenerator(name = "KRIM_ENTITY_NM_ID_S")
47      @GeneratedValue(generator = "KRIM_ENTITY_NM_ID_S")
48      @Id
49      @Column(name = "ENTITY_NM_ID")
50      protected String entityNameId;
51  
52      //@Column(name = "ENTITY_ID")                       
53      @Transient
54      protected String entityId;
55  
56      @Column(name = "NM_TYP_CD")
57      protected String nameCode;
58  
59      @Column(name = "FIRST_NM")
60      protected String firstName;
61  
62      @Column(name = "MIDDLE_NM")
63      protected String middleName;
64  
65      @Column(name = "LAST_NM")
66      protected String lastName;
67  
68      @Column(name = "PREFIX_NM")
69      protected String namePrefix;
70  
71      @Column(name = "TITLE_NM")
72      protected String nameTitle;
73  
74      @Column(name = "SUFFIX_NM")
75      protected String nameSuffix;
76  
77      @Column(name = "NOTE_MSG")
78      protected String noteMessage;
79  
80      @Column(name = "NM_CHNG_DT")
81      protected Timestamp nameChangedDate;
82  
83      @JoinFetch(value= JoinFetchType.OUTER)
84      @ManyToOne(targetEntity = EntityNameTypeBo.class, cascade = { CascadeType.REFRESH })
85      @JoinColumn(name = "NM_TYP_CD", referencedColumnName = "ENT_NM_TYP_CD", insertable = false, updatable = false)
86      protected EntityNameTypeBo entityNameType;
87  
88      public PersonDocumentName() {
89          this.active = true;
90      }
91  
92      /**
93  	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getEntityNameId()
94  	 */
95      public String getEntityNameId() {
96          return entityNameId;
97      }
98  
99      /**
100 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getFirstName()
101 	 */
102     public String getFirstName() {
103         return firstName;
104     }
105 
106     /**
107 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getLastName()
108 	 */
109     public String getLastName() {
110         return lastName;
111     }
112 
113     /**
114 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getMiddleName()
115 	 */
116     public String getMiddleName() {
117         return middleName;
118     }
119 
120     /**
121 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getNameTypeCode()
122 	 */
123     public String getNameCode() {
124         return nameCode;
125     }
126 
127     /**
128 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getNameSuffix()
129 	 */
130     public String getNameSuffix() {
131         return nameSuffix;
132     }
133 
134     /**
135 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getNamePrefix()
136 	 */
137     public String getNamePrefix() {
138         return namePrefix;
139     }
140 
141     public String getNameTitle() {
142         return nameTitle;
143     }
144 
145     public String getNoteMessage() {
146         return noteMessage;
147     }
148 
149     public Timestamp getNameChangedDate() {
150         return nameChangedDate;
151     }
152 
153     public void setFirstName(String firstName) {
154         this.firstName = firstName;
155     }
156 
157     public void setLastName(String lastName) {
158         this.lastName = lastName;
159     }
160 
161     public void setMiddleName(String middleName) {
162         this.middleName = middleName;
163     }
164 
165     public void setNameCode(String nameCode) {
166         this.nameCode = nameCode;
167     }
168 
169     public void setNameSuffix(String nameSuffix) {
170         this.nameSuffix = nameSuffix;
171     }
172 
173     public void setNamePrefix(String namePrefix) {
174         this.namePrefix = namePrefix;
175     }
176 
177     public void setNameTitle(String nameTitle) {
178         this.nameTitle = nameTitle;
179     }
180 
181     public void setNoteMessage(String noteMessage) {
182         this.noteMessage = noteMessage;
183     }
184 
185     public void setNameChangedDate(Timestamp timestamp) {
186         this.nameChangedDate = timestamp;
187     }
188 
189     /**
190 	 * This default implementation formats the name as LAST, FIRST MIDDLE.
191 	 * 
192 	 * @see org.kuali.rice.kim.api.identity.name.EntityNameContract#getCompositeName()
193 	 */
194     public String getCompositeName() {
195         return getLastName() + ", " + getFirstName() + " " + getMiddleName();
196     }
197 
198     public String getEntityId() {
199         return this.entityId;
200     }
201 
202     public void setEntityId(String entityId) {
203         this.entityId = entityId;
204     }
205 
206     public EntityNameTypeBo getEntityNameType() {
207         return this.entityNameType;
208     }
209 
210     public void setEntityNameType(EntityNameTypeBo entityNameType) {
211         this.entityNameType = entityNameType;
212     }
213 
214     public void setEntityNameId(String entityNameId) {
215         this.entityNameId = entityNameId;
216     }
217 }