LeavesHibernateImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package org.yufeng.dao.hibernate;
- import java.util.List;
- import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
- import org.yufeng.dao.ILeavesDao;
- import org.yufeng.domains.Leaves;
- public class LeavesHibernateImpl extends HibernateDaoSupport implements ILeavesDao {
- private ILeavesDao leavesDao;
- public ILeavesDao getLeavesDao() {
- return leavesDao;
- }
- public boolean addLeaves(Leaves leaves) {
- boolean flag = false;
- this.getHibernateTemplate().save(leaves);
- flag = true;
- return flag;
- }
- public List browseALeaves() {
- // TODO Auto-generated method stub
- return this.getHibernateTemplate().find("From Leaves a order by le_id");
- }
- public boolean delLeaves(Leaves leave) {
- boolean flag = false;
- this.getHibernateTemplate().delete(leave);
- flag = true;
- return flag;
- }
- public Leaves loadLeaves(Integer id) {
- return (Leaves) this.getHibernateTemplate().load(Leaves.class, id);
- }
- public boolean updateLeaves(Leaves leaves) {
- boolean flag = false;
- this.getHibernateTemplate().update(leaves);
- flag = true;
- return flag;
- }
- }