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

📄 commondao.java

📁 Fire-Workflow-Engine-All-In-One-20090208 包含全部文档
💻 JAVA
字号:
package org.fireflow.example.data;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class CommonDAO extends HibernateDaoSupport {
	
	/**
	 * 通过流水号查询出业务的任务列表
	 * @param sn
	 * @return
	 */
	public List findWorkItemsForSN(final String sn){
		final String hql = "select wi From org.fireflow.engine.impl.WorkItem as wi ,org.fireflow.example.workflow_ext.MyTaskInstance as taskInst where wi.taskInstance.id=taskInst.id and taskInst.sn=:sn order by wi.createdTime";
		List result = (List)this.getHibernateTemplate().execute(new HibernateCallback(){

			public Object doInHibernate(Session arg0)
					throws HibernateException, SQLException {
				Query query = arg0.createQuery(hql);
				query.setString("sn", sn);
				
				return query.list();
			}
			
		});
		return result;
	}
}

⌨️ 快捷键说明

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