1 /*
2 * Copyright 2008-2009 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.ole.coa.batch.dataaccess.impl;
17
18 import org.apache.ojb.broker.query.Criteria;
19 import org.kuali.ole.sys.OLEConstants;
20 import org.kuali.ole.sys.OLEPropertyConstants;
21 import org.kuali.ole.sys.batch.dataaccess.impl.FiscalYearMakerImpl;
22
23 /**
24 * Performs custom criteria of object code records for a new year being created in the fiscal year maker process
25 */
26 public class ObjectCodeFiscalYearMakerImpl extends FiscalYearMakerImpl {
27
28 /**
29 * @see org.kuali.ole.coa.batch.dataaccess.impl.FiscalYearMakerHelperImpl#createSelectionCriteria(java.lang.Integer)
30 */
31 @Override
32 public Criteria createSelectionCriteria(Integer baseFiscalYear) {
33 // get default criteria equal to base year and active
34 Criteria criteria = super.createSelectionCriteria(baseFiscalYear);
35
36 // or with criteria to pick up budget dummy object for base year (active or inactive)
37 Criteria criteriaBdg = new Criteria();
38 criteriaBdg.addEqualTo(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, baseFiscalYear);
39 // REMOVE: THIS IS REALLY, REALLY BAD! We should not be hard-coding object code values ANYWHERE!
40 criteriaBdg.addEqualTo(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, OLEConstants.BudgetConstructionConstants.OBJECT_CODE_2PLG);
41 criteria.addOrCriteria(criteriaBdg);
42
43 return criteria;
44 }
45
46 }