hibernatecommoninfodao.java

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

JAVA
42
字号
package cn.myapps.core.commoninfo.dao;

import java.util.Collection;

import cn.myapps.base.action.ParamsTable;
import cn.myapps.base.dao.HibernateBaseDAO;
import cn.myapps.core.commoninfo.ejb.CommonInfo;

public class HibernateCommonInfoDAO extends HibernateBaseDAO implements
		CommonInfoDAO {

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

	public Collection queryType(String application) throws Exception {
		String hql = "select distinct vo.type from " + this._voClazzName
				+ " vo where applicationid='" + application + "'";
		return getDatas(hql);
	}

	public Collection queryByType(String type, String application)
			throws Exception {
		String hql = "from " + _voClazzName + " vo where vo.type='" + type
				+ "' and vo.applicationid = '"
					+ application +"' order by vo.orderNo";
//		ParamsTable params = new ParamsTable();
//		params.setParameter("application", application);
//		return getDatas(hql, params);
		return getDatas(hql);

	}

	public CommonInfo findByTypeAndCode(String type, String code,
			String application) throws Exception {
		String hql = "From " + _voClazzName + " vo where vo.type='" + type
				+ "' and vo.code='" + code + "' and vo.applicationid = '"
				+ application + "' order by vo.orderNo";
		return (CommonInfo) this.getData(hql);
	}
}

⌨️ 快捷键说明

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