001/*
002 * Copyright 2008 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 */
016package org.kuali.ole.sys.document.dataaccess.impl;
017
018import org.apache.ojb.broker.query.Criteria;
019import org.apache.ojb.broker.query.QueryFactory;
020import org.kuali.ole.sys.document.dataaccess.FinancialSystemDocumentHeaderDao;
021import org.kuali.rice.krad.bo.DocumentHeader;
022import org.kuali.rice.krad.dao.impl.DocumentHeaderDaoOjb;
023
024/**
025 * This class is the financial system document header dao ojb implementation
026 */
027public class FinancialSystemDocumentHeaderDaoOjb extends DocumentHeaderDaoOjb implements FinancialSystemDocumentHeaderDao {
028
029
030    /*
031     * (non-Javadoc)
032     * 
033     * @see org.kuali.dao.DocumentHeaderDao#getCorrectingDocumentHeader(java.lang.Long)
034     */
035    public DocumentHeader getCorrectingDocumentHeader(String documentId) {
036        Criteria correctedByCriteria = new Criteria();
037        correctedByCriteria.addEqualTo("financialDocumentInErrorNumber", documentId);
038
039        return (DocumentHeader) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(getDocumentHeaderBaseClass(), correctedByCriteria));
040    }
041
042}