1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.dataaccess.impl;
17
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import java.util.Iterator;
21 import java.util.List;
22
23 import org.apache.ojb.broker.query.Criteria;
24 import org.apache.ojb.broker.query.QueryFactory;
25 import org.kuali.ole.coa.businessobject.ObjectCode;
26 import org.kuali.ole.coa.dataaccess.ObjectCodeDao;
27 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
28
29
30
31
32
33 public class ObjectCodeDaoOjb extends PlatformAwareDaoBaseOjb implements ObjectCodeDao {
34 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ObjectCodeDaoOjb.class);
35
36
37
38
39
40 public List getYearList(String chartOfAccountsCode, String financialObjectCode) {
41
42 List returnList = new ArrayList();
43 Criteria criteria = new Criteria();
44 criteria.addEqualTo("chartOfAccountsCode", chartOfAccountsCode);
45 criteria.addEqualTo("financialObjectCode", financialObjectCode);
46 Collection years = getPersistenceBrokerTemplate().getCollectionByQuery(QueryFactory.newQuery(ObjectCode.class, criteria));
47 for (Iterator iter = years.iterator(); iter.hasNext();) {
48 ObjectCode o = (ObjectCode) iter.next();
49 if (o != null) {
50 returnList.add(o.getUniversityFiscalYear());
51 }
52 }
53 return returnList;
54
55
56 }
57 }