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

📄 commondaohibernateimpl.java

📁 新技术论坛系统 v1.0 前后台管理的初始用户名 : admin 密码 123456
💻 JAVA
字号:
package com.ntsky.bbs.dao.hibernate;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.dao.DataAccessException;

import org.hibernate.cache.EhCacheProvider;

import com.ntsky.bbs.domain.Common;
import com.ntsky.bbs.domain.Poll;
import com.ntsky.bbs.dao.CommonDAO;
import com.ntsky.bbs.exception.DAOException;
import com.ntsky.bbs.util.page.Pagination;
import com.ntsky.bbs.util.page.QueryResult;

/**
 * 公共类别Hibernate数据处理实现 
 * 
 * @author ntsky
 * @link www.ntsky.com
 * 
 * @version $Revision: 1.2 $ $Date: 2006/08/05 14:45:18 $
 */
public class CommonDAOHibernateImpl extends BaseDAOHibernateImpl implements CommonDAO {
	
	/**
	 * 查找全部头像类别
	 * @return List 头像信息
	 * @throws DAOException
	 */
	public List findFaceTypes() throws DAOException {
		try{
			//return super.find("from Common as c left outer join c.faces as face with face.type=c.id where c.type=1 group by c.id");
			return super.find("from Common as c where c.type=1 order by c.id asc");
		}
		catch(DAOException daoException){
			throw new DAOException("列表全部头像发生错误...");
		}			
	}
	
	/**
	 * 查找全部的帮助类别
	 * @return
	 * @throws DAOException
	 */
	public List findHelpTypes()	throws DAOException{
		try{
			//return super.find("from Common as c inner join fetch c.helps as help where c.type=2 and help.isHand=0 order by c.id asc");
			return super.find("from Common as c where c.type=2 order by c.id asc");
		}
		catch(DAOException daoException){
			throw new DAOException("列表全部帮助类别发生错误...");
		}		
	} 
	
}

⌨️ 快捷键说明

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