Coverage Report - org.kuali.rice.kns.dao.proxy.DocumentHeaderDaoProxy
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentHeaderDaoProxy
0%
0/10
0%
0/6
1.6
 
 1  
 /*
 2  
  * Copyright 2005-2008 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.rice.kns.dao.proxy;
 17  
 
 18  
 import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
 19  
 import org.kuali.rice.kns.bo.DocumentHeader;
 20  
 import org.kuali.rice.kns.dao.DocumentHeaderDao;
 21  
 
 22  0
 public class DocumentHeaderDaoProxy implements DocumentHeaderDao {
 23  
     private DocumentHeaderDao documentHeaderDaoJpa;
 24  
     private DocumentHeaderDao documentHeaderDaoOjb;
 25  
         
 26  
     private DocumentHeaderDao getDao(Class clazz) {
 27  0
             final String TMP_NM = clazz.getName();
 28  0
                 final int START_INDEX = TMP_NM.indexOf('.', TMP_NM.indexOf('.') + 1) + 1;
 29  0
             return (OrmUtils.isJpaAnnotated(clazz) && (OrmUtils.isJpaEnabled() || OrmUtils.isJpaEnabled("rice.kns"))) ?
 30  
                                                 documentHeaderDaoJpa : documentHeaderDaoOjb; 
 31  
     }
 32  
     
 33  
     public DocumentHeader getByDocumentHeaderId(String id) {            
 34  0
             return getDao(DocumentHeader.class).getByDocumentHeaderId(id);
 35  
     }
 36  
 
 37  
         public Class getDocumentHeaderBaseClass() {
 38  0
                 return getDao(DocumentHeader.class).getDocumentHeaderBaseClass();
 39  
         }
 40  
 
 41  
         public void setDocumentHeaderDaoJpa(DocumentHeaderDao documentHeaderDaoJpa) {
 42  0
                 this.documentHeaderDaoJpa = documentHeaderDaoJpa;
 43  0
         }
 44  
 
 45  
         public void setDocumentHeaderDaoOjb(DocumentHeaderDao documentHeaderDaoOjb) {
 46  0
                 this.documentHeaderDaoOjb = documentHeaderDaoOjb;
 47  0
         }
 48  
 
 49  
 }