hibernatenodertdao.java

来自「OBPM是一个开源」· Java 代码 · 共 47 行

JAVA
47
字号
package cn.myapps.core.workflow.storage.runtime.dao;

import java.util.Collection;
import java.util.Iterator;

import cn.myapps.base.dao.HibernateBaseDAO;
import cn.myapps.core.user.action.WebUser;
import cn.myapps.core.workflow.storage.runtime.ejb.ActorRT;
import cn.myapps.core.workflow.storage.runtime.ejb.NodeRT;

public class HibernateNodeRTDAO extends HibernateBaseDAO implements NodeRTDAO {

	public HibernateNodeRTDAO(String voClassName) {
		super(voClassName);
	}

	public Collection queryNodeRTByDocidAndFlowid(String docid, String flowid)
			throws Exception {
		String hql = "FROM " + _voClazzName + " vo WHERE " + "vo.docid='"
				+ docid + "' AND vo.flowid='" + flowid + "'";
		return this.getDatas(hql, null);
	}

	public NodeRT findNodeRT(String docid, String flowid, WebUser user)
			throws Exception {
		Collection nodertList = query(docid, flowid);
		for (Iterator iter = nodertList.iterator(); iter.hasNext();) {
			NodeRT nodert = (NodeRT) iter.next();
			Iterator it = nodert.getActorrts().iterator();
			while (it.hasNext()) {
				ActorRT actorrt = (ActorRT) it.next();
				if ((actorrt).isEquals(user) && !actorrt.getIsprocessed()) {
					return nodert;
				}
			}
		}
		return null;
	}

	public Collection query(String docid, String flowid) throws Exception {
		String hql = "FROM " + _voClazzName + " vo WHERE " + "vo.docid='"
				+ docid + "' AND vo.flowid='" + flowid + "'";

		return this.getDatas(hql, null);
	}
}

⌨️ 快捷键说明

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