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

📄 hibernateimagerepositorydao.java

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

import java.util.Collection;

import cn.myapps.base.action.ParamsTable;
import cn.myapps.base.dao.HibernateBaseDAO;
import cn.myapps.core.image.repository.ejb.ImageRepositoryVO;

public class HibernateImageRepositoryDAO extends HibernateBaseDAO implements
		ImageRepositoryDAO {
	public HibernateImageRepositoryDAO(String voClassName) {
		super(voClassName);
	}

	public ImageRepositoryVO getImageRepositoryByName(String name,
			String application) throws Exception {
		String hql = "from ImageRepositoryVO rp where rp.name=" + "'" + name
				+ "'";

		if (application != null && application.length() > 0) {
			hql += (" and rp.applicationid = '" + application + "' ");
		}

		return (ImageRepositoryVO) this.getData(hql);
	}

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

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

	public Collection getImageRepositoryByApplication(String applicationid,
			String application) throws Exception {

		String hql = "from ImageRepositoryVO sp where (sp.applicationid='"
				+ applicationid + "'" + " ) "
				+ " and sp.module is null";
		   ParamsTable params=new ParamsTable();
		   params.setParameter("application",application);
		   return getDatas(hql, params);
	}

	public ImageRepositoryVO getImageRepositoryByIconURl(String IconURl,
			String application) throws Exception {
		String hql = "from ImageRepositoryVO rp where content=" + "'" + IconURl
				+ "'";
		
		if (application != null && application.length()>0) {
			hql+=(" and rp.applicationid = '"+application+"' ");
		}
		
		return (ImageRepositoryVO) this.getData(hql);
	}
}

⌨️ 快捷键说明

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