📄 actiondaohibernate.java
字号:
package org.appfuse.dao.hibernate;
import java.util.List;
import org.springframework.orm.ObjectRetrievalFailureException;
import org.appfuse.dao.*;
import org.appfuse.model.Action;
import org.appfuse.util.exception.AppDAOException;
import org.appfuse.model.RoleAuth;
/**
* @author user
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class ActionDAOHibernate
extends BaseDAOHibernate
implements ActionDAO {
public Action getAction(int actionid) throws AppDAOException {
Action action = (Action) getHibernateTemplate().get(Action.class,
new Integer(actionid));
if (action == null) {
throw new ObjectRetrievalFailureException(Action.class,
new Integer(actionid));
}
return action;
}
public List getActions(Action action) throws AppDAOException {
return getHibernateTemplate().find(
"from Action");
}
public void saveAction(final Action action) throws AppDAOException {
getHibernateTemplate().saveOrUpdate(action);
getHibernateTemplate().flush();
}
public void removeAction(int actionid) throws AppDAOException {
Action action = getAction(actionid);
getHibernateTemplate().delete(action);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -