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.sys.dataaccess.impl; 017 018 import org.apache.log4j.Logger; 019 import org.apache.ojb.broker.query.Criteria; 020 import org.apache.ojb.broker.query.QueryByCriteria; 021 import org.apache.ojb.broker.query.QueryFactory; 022 import org.kuali.kfs.sys.businessobject.OriginationCode; 023 import org.kuali.kfs.sys.dataaccess.OriginationCodeDao; 024 import org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb; 025 026 public class OriginationCodeDaoOjb extends PlatformAwareDaoBaseOjb implements OriginationCodeDao { 027 private static Logger LOG = Logger.getLogger(OriginationCodeDaoOjb.class); 028 029 public OriginationCodeDaoOjb() { 030 super(); 031 } 032 033 /* 034 * (non-Javadoc) 035 * 036 * @see org.kuali.rice.kns.dao.OriginationCodeDao#delete(org.kuali.rice.kns.bo.OriginationCode) 037 */ 038 public void delete(OriginationCode code) { 039 getPersistenceBrokerTemplate().delete(code); 040 } 041 042 /* 043 * (non-Javadoc) 044 * 045 * @see org.kuali.rice.kns.dao.OriginationCodeDao#findByCode(java.lang.String) 046 */ 047 public OriginationCode findByCode(String originationCode) { 048 // TODO Auto-generated method stub 049 Criteria criteria = new Criteria(); 050 criteria.addEqualTo("FS_ORIGIN_CD", originationCode); 051 052 QueryByCriteria query = QueryFactory.newQuery(OriginationCode.class, criteria); 053 return (OriginationCode) getPersistenceBrokerTemplate().getObjectByQuery(query); 054 } 055 056 /* 057 * (non-Javadoc) 058 * 059 * @see org.kuali.rice.kns.dao.OriginationCodeDao#save(org.kuali.rice.kns.bo.OriginationCode) 060 */ 061 public void save(OriginationCode code) { 062 getPersistenceBrokerTemplate().store(code); 063 } 064 065 066 }