⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hibernateaction.java

📁 webwork学习文档.doc 初学者使用
💻 JAVA
字号:
package cash.action;import org.apache.log4j.Logger;import com.opensymphony.xwork.ActionContext;import com.opensymphony.xwork.ActionSupport;/** * Superclass for Hibernate-aware actions. * * @author Joel Hockey * @version $Id: HibernateAction.java,v 1.9 2004/12/14 22:45:55 plightbo Exp $ */public abstract class HibernateAction extends ActionSupport {    /** xwork action return code */    public static final String DBERROR = "dberror";    private static final Logger LOG = Logger.getLogger(HibernateAction.class);    private boolean m_rollback = false;    /** roll back the current session */    protected void setRollbackOnly() { m_rollback = true; }    /** @return whether the current Hibernate Session should be rolled back */    public boolean getRollback() { return m_rollback; }    /**     * Sets an object into the web session     * @param key Key used to index object     * @param object The object to store     */    public void set(Object key, Object object) {        ActionContext.getContext().getSession().put(key, object);    }    /**     * Retrieve object from web session     * @param key Key used to index object     * @return object if it exists, or null     */    public Object get(Object key) {        return ActionContext.getContext().getSession().get(key);    }}

⌨️ 快捷键说明

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