package com.yihu.hos.resource.dao.impl;

import com.yihu.hos.web.framework.dao.SQLGeneralDAO;
import com.yihu.hos.resource.dao.IRsAppResourceDetailDao;
import com.yihu.hos.resource.model.RsAppResourceDetail;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by chenweida on 2016/1/25.
 */
@Repository("rsAppResourceDetailDao")
public class RsAppResourceDetailDaoImpl extends SQLGeneralDAO implements IRsAppResourceDetailDao {

    @Override
    public List<RsAppResourceDetail> getAppResourceDetailByAppResouceId(String id) throws Exception {
        return (List<RsAppResourceDetail>) super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id);
    }

    @Override
    public void deleteByAppResourceId(String id) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id));
    }
}
