001 /**
002 * Copyright 2005-2013 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.rice.kew.rule.dao.impl;
017
018 import org.apache.ojb.broker.query.QueryByCriteria;
019 import org.kuali.rice.kew.rule.RuleResponsibilityBo;
020 import org.kuali.rice.kew.rule.dao.RuleResponsibilityDAO;
021 import org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport;
022
023
024 public class RuleResponsibilityDAOOjbImpl extends PersistenceBrokerDaoSupport implements RuleResponsibilityDAO {
025
026 /*
027 * (non-Javadoc)
028 *
029 * @see org.kuali.rice.kew.rule.dao.RuleTemplateAttributeDAO#delete(java.lang.Long)
030 */
031 public void delete(String ruleResponsibilityId) {
032 this.getPersistenceBrokerTemplate().delete(findByRuleResponsibilityId(ruleResponsibilityId));
033 }
034
035 /*
036 * (non-Javadoc)
037 *
038 * @see org.kuali.rice.kew.rule.dao.RuleTemplateAttributeDAO#findByRuleTemplateAttributeId(java.lang.Long)
039 */
040 public RuleResponsibilityBo findByRuleResponsibilityId(String ruleResponsibilityId) {
041 RuleResponsibilityBo ruleResponsibility = new RuleResponsibilityBo();
042 ruleResponsibility.setId(ruleResponsibilityId);
043 return (RuleResponsibilityBo) this.getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(ruleResponsibility));
044 }
045 }