View Javadoc

1   /**
2    * Copyright 2005-2013 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.impl.identity.residency;
17  
18  import org.joda.time.DateTime;
19  import org.kuali.rice.kim.api.identity.CodedAttributeContract;
20  import org.kuali.rice.kim.api.identity.residency.EntityResidency;
21  import org.kuali.rice.kim.api.identity.residency.EntityResidencyContract;
22  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23  import org.kuali.rice.krad.data.jpa.eclipselink.PortableSequenceGenerator;
24  
25  import javax.persistence.Column;
26  import javax.persistence.Entity;
27  import javax.persistence.GeneratedValue;
28  import javax.persistence.Id;
29  import javax.persistence.Table;
30  
31  @Entity
32  @Table(name = "KRIM_ENTITY_RESIDENCY_T")
33  public class EntityResidencyBo extends PersistableBusinessObjectBase implements EntityResidencyContract {
34      private static final long serialVersionUID = 1L;
35      @Id
36      @GeneratedValue(generator = "KRIM_ENTITY_RESIDENCY_ID_S")
37      @PortableSequenceGenerator(name = "KRIM_ENTITY_RESIDENCY_ID_S")
38      @Column(name = "ID")
39      private String id;
40      @Column(name = "ENTITY_ID")
41      private String entityId;
42      @Column(name = "DETERMINATION_METHOD")
43      private String determinationMethod;
44      @Column(name = "IN_STATE")
45      private String inState;
46  
47      public static EntityResidency to(EntityResidencyBo bo) {
48          if (bo == null) {
49              return null;
50          }
51  
52          return EntityResidency.Builder.create(bo).build();
53      }
54  
55      /**
56       * Creates a EntityResidencyBo business object from an immutable representation of a EntityResidency.
57       *
58       * @param immutable an immutable EntityResidency
59       * @return a EntityResidencyBo
60       */
61      public static EntityResidencyBo from(EntityResidency immutable) {
62          if (immutable == null) {
63              return null;
64          }
65  
66          EntityResidencyBo bo = new EntityResidencyBo();
67          bo.entityId = immutable.getEntityId();
68          bo.id = immutable.getId();
69          bo.determinationMethod = immutable.getDeterminationMethod();
70          bo.inState = immutable.getInState();
71          bo.setVersionNumber(immutable.getVersionNumber());
72          bo.setObjectId(immutable.getObjectId());
73  
74          return bo;
75      }
76  
77      @Override
78      public DateTime getEstablishedDate() {
79          return null;//To change body of implemented methods use File | Settings | File Templates.
80      }
81  
82      @Override
83      public DateTime getChangeDate() {
84          return null;//To change body of implemented methods use File | Settings | File Templates.
85      }
86  
87      @Override
88      public String getCountryCode() {
89          return null;//To change body of implemented methods use File | Settings | File Templates.
90      }
91  
92      @Override
93      public String getCountyCode() {
94          return null;//To change body of implemented methods use File | Settings | File Templates.
95      }
96  
97      @Override
98      public String getStateProvinceCode() {
99          return null;//To change body of implemented methods use File | Settings | File Templates.
100     }
101 
102     @Override
103     public CodedAttributeContract getResidencyStatus() {
104         return null;//To change body of implemented methods use File | Settings | File Templates.
105     }
106 
107     @Override
108     public CodedAttributeContract getResidencyType() {
109         return null;//To change body of implemented methods use File | Settings | File Templates.
110     }
111 
112     @Override
113     public String getId() {
114         return id;
115     }
116 
117     public void setId(String id) {
118         this.id = id;
119     }
120 
121     @Override
122     public String getEntityId() {
123         return entityId;
124     }
125 
126     public void setEntityId(String entityId) {
127         this.entityId = entityId;
128     }
129 
130     @Override
131     public String getDeterminationMethod() {
132         return determinationMethod;
133     }
134 
135     public void setDeterminationMethod(String determinationMethod) {
136         this.determinationMethod = determinationMethod;
137     }
138 
139     @Override
140     public String getInState() {
141         return inState;
142     }
143 
144     public void setInState(String inState) {
145         this.inState = inState;
146     }
147 
148 }