001 /**
002 * Copyright 2004-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.hr.time.department;
017
018 import java.sql.Date;
019 import java.sql.Timestamp;
020 import java.util.ArrayList;
021 import java.util.LinkedList;
022 import java.util.List;
023
024 import org.kuali.hr.core.KPMEConstants;
025 import org.kuali.hr.location.Location;
026 import org.kuali.hr.time.HrBusinessObject;
027 import org.kuali.hr.time.roles.TkRole;
028 import org.kuali.kfs.coa.businessobject.Chart;
029 import org.kuali.kfs.coa.businessobject.Organization;
030
031 public class Department extends HrBusinessObject {
032 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "Department";
033 private static final long serialVersionUID = 1L;
034
035 private String hrDeptId;
036 private String dept;
037 private String description;
038 private String chart;
039 private String org;
040 private String location;
041
042 private Chart chartObj;
043 private Organization orgObj;
044 private Location locationObj;
045
046 private List<TkRole> roles = new LinkedList<TkRole>();
047 private List<TkRole> inactiveRoles = new ArrayList<TkRole>();
048
049 public String getDescription() {
050 return description;
051 }
052
053 public void setDescription(String description) {
054 this.description = description;
055 }
056
057 public String getChart() {
058 return chart;
059 }
060
061 public void setChart(String chart) {
062 this.chart = chart;
063 }
064
065 public String getOrg() {
066 return org;
067 }
068
069 public void setOrg(String org) {
070 this.org = org;
071 }
072
073 public String getHrDeptId() {
074 return hrDeptId;
075 }
076
077 public void setHrDeptId(String hrDeptId) {
078 this.hrDeptId = hrDeptId;
079 }
080
081 public String getDept() {
082 return dept;
083 }
084
085 public void setDept(String dept) {
086 this.dept = dept;
087 }
088
089 public Date getEffectiveDate() {
090 return effectiveDate;
091 }
092
093 public void setEffectiveDate(Date effectiveDate) {
094 this.effectiveDate = effectiveDate;
095 }
096
097 public Timestamp getTimestamp() {
098 return timestamp;
099 }
100
101 public void setTimestamp(Timestamp timestamp) {
102 this.timestamp = timestamp;
103 }
104
105 public Boolean getActive() {
106 return active;
107 }
108
109 public void setActive(Boolean active) {
110 this.active = active;
111 }
112
113 public Chart getChartObj() {
114 return chartObj;
115 }
116
117 public void setChartObj(Chart chartObj) {
118 this.chartObj = chartObj;
119 }
120
121 public Organization getOrgObj() {
122 return orgObj;
123 }
124
125 public void setOrgObj(Organization orgObj) {
126 this.orgObj = orgObj;
127 }
128
129 public List<TkRole> getRoles() {
130 return roles;
131 }
132
133 public void setRoles(List<TkRole> roles) {
134 this.roles = roles;
135 }
136
137 public List<TkRole> getInactiveRoles() {
138 return inactiveRoles;
139 }
140
141
142 public void setInactiveRoles(List<TkRole> inactiveRoles) {
143 this.inactiveRoles = inactiveRoles;
144 }
145
146
147 @Override
148 public String getUniqueKey() {
149 return getDept() + "_" + getOrg() + "_" + getChart() + getRoles().size();
150 }
151
152 @Override
153 public String getId() {
154 return getHrDeptId();
155 }
156
157 @Override
158 public void setId(String id) {
159 setHrDeptId(id);
160 }
161
162 public String getLocation() {
163 return location;
164 }
165
166 public void setLocation(String location) {
167 this.location = location;
168 }
169
170 public Location getLocationObj() {
171 return locationObj;
172 }
173
174 public void setLocationObj(Location locationObj) {
175 this.locationObj = locationObj;
176 }
177 }