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.role;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.rice.kim.impl.common.attribute.KimAttributeDataBo;
20  
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.Id;
25  import javax.persistence.Table;
26  
27  /**
28   * /**
29   * The column names have been used in a native query in RoleDaoOjb and will need to be modified if any changes to the
30   * column names are made here.
31   */
32  @Entity
33  @Table(name = "KRIM_ROLE_MBR_ATTR_DATA_T")
34  public class RoleMemberAttributeDataBo extends KimAttributeDataBo {
35  
36      @Id
37      @GeneratedValue(generator = "KRIM_ATTR_DATA_ID_S")
38      @Column(name="ATTR_DATA_ID")
39      private String id;
40  
41      @Column(name = "ROLE_MBR_ID")
42      protected String assignedToId;
43  
44      @Override
45      public String getId() {
46          return id;
47      }
48  
49      @Override
50      public void setId(String id) {
51          this.id = id;
52      }
53  
54      @Override
55      public String getAssignedToId() {
56          return this.assignedToId;
57      }
58  
59      @Override
60      public void setAssignedToId(String roleMemberId) {
61          this.assignedToId = roleMemberId;
62      }
63  
64      public boolean equals(RoleMemberAttributeDataBo roleMemberAttributeDataBo) {
65          if (!StringUtils.equals(roleMemberAttributeDataBo.getKimTypeId(), getKimTypeId())) {
66              return false;
67          }
68  
69          if (!StringUtils.equals(roleMemberAttributeDataBo.getKimAttributeId(), getKimAttributeId())) {
70              return false;
71          }
72  
73          if (!StringUtils.equals(roleMemberAttributeDataBo.getAttributeValue(), getAttributeValue())) {
74              return false;
75          }
76  
77          return true;
78      }
79  
80  }