Coverage Report - org.kuali.rice.ksb.messaging.bam.dao.impl.BAMDAOOjbImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
BAMDAOOjbImpl
0%
0/22
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007 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.ksb.messaging.bam.dao.impl;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import javax.xml.namespace.QName;
 21  
 
 22  
 import org.apache.ojb.broker.query.Criteria;
 23  
 import org.apache.ojb.broker.query.QueryByCriteria;
 24  
 import org.kuali.rice.core.reflect.ObjectDefinition;
 25  
 import org.kuali.rice.ksb.messaging.bam.BAMParam;
 26  
 import org.kuali.rice.ksb.messaging.bam.BAMTargetEntry;
 27  
 import org.kuali.rice.ksb.messaging.bam.dao.BAMDAO;
 28  
 import org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport;
 29  
 
 30  
 
 31  0
 public class BAMDAOOjbImpl extends PersistenceBrokerDaoSupport implements BAMDAO {
 32  
 
 33  
         public void clearBAMTables() {
 34  0
                 getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(BAMTargetEntry.class));
 35  0
                 getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(BAMParam.class));
 36  0
         }
 37  
 
 38  
         @SuppressWarnings("unchecked")
 39  
         public List<BAMTargetEntry> getCallsForService(QName serviceName, String methodName) {
 40  0
                 Criteria crit = new Criteria();
 41  0
                 crit.addEqualTo("serviceName", serviceName.toString());
 42  0
                 crit.addEqualTo("methodName", methodName);
 43  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 44  
         }
 45  
 
 46  
         public void save(BAMTargetEntry bamEntry) {
 47  0
                 this.getPersistenceBrokerTemplate().store(bamEntry);
 48  0
         }
 49  
 
 50  
         @SuppressWarnings("unchecked")
 51  
         public List<BAMTargetEntry> getCallsForService(QName serviceName) {
 52  0
                 Criteria crit = new Criteria();
 53  0
                 crit.addEqualTo("serviceName", serviceName.toString());
 54  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 55  
         }
 56  
 
 57  
         @SuppressWarnings("unchecked")
 58  
         public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef) {
 59  0
                 Criteria crit = new Criteria();
 60  0
                 QName qname = new QName(objDef.getServiceNamespace(), objDef.getClassName());
 61  0
                 crit.addLike("serviceName", qname.toString() + "%");
 62  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 63  
         }
 64  
 
 65  
         @SuppressWarnings("unchecked")
 66  
         public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef, String methodName) {
 67  0
                 Criteria crit = new Criteria();
 68  0
                 QName qname = new QName(objDef.getServiceNamespace(), objDef.getClassName());
 69  0
                 crit.addLike("serviceName", qname.toString() + "%");
 70  0
                 crit.addEqualTo("methodName", methodName);
 71  0
                 return (List<BAMTargetEntry>)getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(BAMTargetEntry.class, crit));
 72  
         }
 73  
 }