actiondaoimpl.java

来自「jsf+spring+ibatis 的一个程序,主要用来介绍JSF程序.」· Java 代码 · 共 33 行

JAVA
33
字号
package com.wxd.common.popedom.persistence.dao;

import java.util.List;
import java.util.Map;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.wxd.common.popedom.persistence.entity.Action;

public class ActionDaoImpl extends HibernateDaoSupport implements ActionDao {
	public void save(Action action){
		this.getHibernateTemplate().saveOrUpdate(action);
	}
	
	public void delete(Action action){
		this.getHibernateTemplate().delete(action);
	}
	

	public Action getActionFromId(int actionId) {
		return (Action)getSession().createQuery("from Action action where action.id=:id").setInteger("id", new Integer(actionId)).uniqueResult();
	}

	public Action getActionFromName(String actionName) {
		return (Action)getSession().createQuery("from Action action where action.actionView=:name").setString("name", actionName).uniqueResult();
	}

	public List getAllActions() {
		return this.getHibernateTemplate().loadAll(Action.class);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?