View Javadoc
1   /**
2    * Copyright 2004-2014 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.kpme.core.departmentaffiliation.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.core.api.departmentaffiliation.DepartmentAffiliation;
22  import org.kuali.kpme.core.api.departmentaffiliation.service.DepartmentAffiliationService;
23  import org.kuali.kpme.core.departmentaffiliation.DepartmentAffiliationBo;
24  import org.kuali.kpme.core.departmentaffiliation.dao.DepartmentAffiliationDao;
25  import org.kuali.rice.core.api.mo.ModelObjectUtils;
26  
27  public class DepartmentAffiliationServiceImpl implements DepartmentAffiliationService {
28  
29  	private DepartmentAffiliationDao departmentAffiliationDao;
30  
31  	/**
32  	 * @return the departmentAffiliationDao
33  	 */
34  	public DepartmentAffiliationDao getDepartmentAffiliationDao() {
35  		return departmentAffiliationDao;
36  	}
37  
38  	/**
39  	 * @param departmentAffiliationDao the departmentAffiliationDao to set
40  	 */
41  	public void setDepartmentAffiliationDao(
42  			DepartmentAffiliationDao departmentAffiliationDao) {
43  		this.departmentAffiliationDao = departmentAffiliationDao;
44  	}
45  
46  	@Override
47  	public DepartmentAffiliation getDepartmentAffiliationById(
48  			String hrDeptAfflId) {
49  		return DepartmentAffiliationBo.to(this.departmentAffiliationDao.getDepartmentAffiliationById(hrDeptAfflId));
50  	}
51  	
52  	@Override
53  	public DepartmentAffiliation getDepartmentAffiliationByType(String deptAfflType) {
54  		return DepartmentAffiliationBo.to(this.departmentAffiliationDao.getDepartmentAffiliationByType(deptAfflType));
55  	}
56  	
57  	@Override
58  	public List<DepartmentAffiliation> getDepartmentAffiliationList(String deptAfflType, LocalDate asOfDate) {
59  		return ModelObjectUtils.transform(this.departmentAffiliationDao.getDepartmentAffiliationList(deptAfflType, asOfDate),DepartmentAffiliationBo.toImmutable);
60  	}
61  
62  	@Override
63  	public List<DepartmentAffiliation> getAllActiveAffiliations() {
64  		return ModelObjectUtils.transform(this.departmentAffiliationDao.getAllActiveAffiliations(),DepartmentAffiliationBo.toImmutable);
65  	}
66  
67  
68      @Override
69      public DepartmentAffiliation getPrimaryAffiliation() {
70          return DepartmentAffiliationBo.to(this.departmentAffiliationDao.getPrimaryAffiliation());
71      }
72  }