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

📄 hibernatestylerepositorydao.java

📁 OBPM是一个开源
💻 JAVA
字号:
package cn.myapps.core.style.repository.dao;

import java.util.Collection;
import java.util.HashSet;

import cn.myapps.base.action.ParamsTable;
import cn.myapps.base.dao.HibernateBaseDAO;
import cn.myapps.core.style.repository.ejb.StyleRepositoryVO;

public class HibernateStyleRepositoryDAO extends HibernateBaseDAO implements
		StyleRepositoryDAO {
	public HibernateStyleRepositoryDAO(String voClassName) {
		super(voClassName);
	}

	public StyleRepositoryVO getRepositoryByName(String name, String application)
			throws Exception {
		String hql = "from StyleRepositoryVO sp where sp.name=" + "'" + name
				+ "'";
		
		if (application != null && application.length()>0) {
			hql+=(" and vo.applicationid = '"+application+"' ");
		}
		
		return (StyleRepositoryVO) this.getData(hql);
	}

	public Collection getStyleRepositoryByModule(String moduleid,
			String application) throws Exception {

		String hql = "from StyleRepositoryVO sp where sp.module.id='"
				+ moduleid + "'";
		   ParamsTable params=new ParamsTable();
		   params.setParameter("application",application);
		   return getDatas(hql, params);
	}

	public Collection getStyleRepositoryByApplication(String applicationid) throws Exception {

		String hql = "from StyleRepositoryVO sp where (sp.applicationid='"
				+ applicationid + "' ) "
				+ " and sp.module is null";
		   return getDatas(hql);
	}
}

⌨️ 快捷键说明

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