Coverage Report - org.kuali.rice.kew.rule.dao.impl.RuleTemplateOptionDAOJpaImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleTemplateOptionDAOJpaImpl
0%
0/11
0%
0/2
1.2
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.rule.dao.impl;
 18  
 
 19  
 import javax.persistence.EntityManager;
 20  
 import javax.persistence.PersistenceContext;
 21  
 
 22  
 import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
 23  
 import org.kuali.rice.kew.rule.RuleTemplateOption;
 24  
 import org.kuali.rice.kew.rule.dao.RuleTemplateOptionDAO;
 25  
 
 26  
 
 27  0
 public class RuleTemplateOptionDAOJpaImpl implements RuleTemplateOptionDAO {
 28  
 
 29  
         @PersistenceContext(unitName="kew-unit")
 30  
         private EntityManager entityManager;
 31  
         
 32  
   /*
 33  
    * (non-Javadoc)
 34  
    * @see org.kuali.rice.kew.rule.dao.RuleTemplateOptionDAO#delete(java.lang.Long)
 35  
    */
 36  
   public void delete(String ruleTemplateOptionId) {
 37  0
           entityManager.remove(findByRuleTemplateOptionId(ruleTemplateOptionId));
 38  0
   }
 39  
 
 40  
   /*
 41  
    * (non-Javadoc)
 42  
    * @see org.kuali.rice.kew.rule.dao.RuleTemplateOptionDAO#findByRuleTemplateOptionId(java.lang.Long)
 43  
    */
 44  
   public RuleTemplateOption findByRuleTemplateOptionId(String ruleTemplateOptionId) {
 45  0
           return entityManager.find(RuleTemplateOption.class, ruleTemplateOptionId);
 46  
   }
 47  
   
 48  
   public void save (RuleTemplateOption ruleTemplateOption){
 49  0
           if(ruleTemplateOption.getRuleTemplateOptionId()==null){
 50  0
                   entityManager.persist(ruleTemplateOption);
 51  
           }else{
 52  0
                   OrmUtils.merge(entityManager, ruleTemplateOption);
 53  
           }
 54  0
   }
 55  
 
 56  
     public EntityManager getEntityManager() {
 57  0
         return this.entityManager;
 58  
     }
 59  
     
 60  
     public void setEntityManager(EntityManager entityManager) {
 61  0
         this.entityManager = entityManager;
 62  0
     }
 63  
 }