View Javadoc

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