001 /*
002 * Copyright 2011 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.kfs.coa.dataaccess;
017
018 import java.util.List;
019
020 import org.kuali.kfs.coa.businessobject.Organization;
021
022 /**
023 * This interface defines data access methods for {@link Org}
024 */
025 public interface OrganizationDao {
026 /**
027 * This method retrieves a {@link Org} based on primary keys
028 *
029 * @param chartOfAccountsCode
030 * @param organizationCode
031 * @return an {@link Org} based on primary keys
032 */
033 public Organization getByPrimaryId(String chartOfAccountsCode, String organizationCode);
034
035 /**
036 * This method saves a specific {@link Org}
037 *
038 * @param organization
039 */
040 public void save(Organization organization);
041
042 /**
043 * This method retrieves a list of active {@link Org}s defined by their chart and organization code
044 *
045 * @param chartOfAccountsCode
046 * @param organizationCode
047 * @return a list of active {@link Org}s by chart and organization code
048 */
049 public List getActiveAccountsByOrg(String chartOfAccountsCode, String organizationCode);
050
051 /**
052 * This method retrieves a list of active child {@link Org}s based on their parent's organization code and chart code
053 *
054 * @param chartOfAccountsCode
055 * @param organizationCode
056 * @return a list of active {@link Org}s by their parent's chart and organization code
057 */
058 public List getActiveChildOrgs(String chartOfAccountsCode, String organizationCode);
059
060 /**
061 * Returns a list of active organizations with the given organization type code.
062 *
063 * @param organizationType
064 * @return a list of active {@link Org}s based on their organization type code
065 */
066 public List<Organization> getActiveOrgsByType(String organizationTypeCode);
067
068 /**
069 * This method retrieves a list of root organization codes (as a string array) based on their root chart and reports to org type
070 * code
071 *
072 * @param rootChart
073 * @param selfReportsOrgTypeCode
074 * @return a string array of root org codes based on root chart and reports to org type code
075 */
076 public String[] getRootOrganizationCode(String rootChart, String selfReportsOrgTypeCode);
077
078 }