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

📄 noallowedcharimpl.java

📁 野蔷薇论坛源码 java 自己看看吧。 学习用
💻 JAVA
字号:
/* 
 * Created on 2006-2-25
 * Last modified on 2007-11-3
 * Powered by YeQiangWei.com
 */
package com.yeqiangwei.club.dao.hibernate.impl;

import java.util.List;

import org.hibernate.HibernateException;

import com.yeqiangwei.club.dao.NoAllowedCharDAO;
import com.yeqiangwei.club.dao.hibernate.support.HibernateFacade;
import com.yeqiangwei.club.dao.hibernate.support.HibernateProvider;
import com.yeqiangwei.club.dao.model.NoAllowedChar;
import com.yeqiangwei.club.exception.DAOException;
import com.yeqiangwei.club.param.BaseParameter;



public class NoAllowedCharImpl implements NoAllowedCharDAO{
	
	private static final String FIND_ALL = "from NoAllowedChar ";
	
	//private static final String FIND_NOALLOWEDID = "from NoAllowedChar where noAllowedId=?";
	
	private static final String DELETE_NOALLOWEDID = "DELETE FROM NoAllowedChar where noAllowedId=?";
	
	private static final String DELETES_NOALLOWEDID = "DELETE FROM NoAllowedChar where noAllowedId in (:ids)";

	public void create(NoAllowedChar item) throws DAOException {
		HibernateProvider<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		try{
			facade.save(item);
		}catch(HibernateException e){
			throw new DAOException(e);
		}
	}

	public void update(NoAllowedChar item) throws DAOException {
		HibernateProvider<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		try{
			facade.update(item);
		}catch(HibernateException e){
			throw new DAOException(e);
		}
	}

	public int delete(NoAllowedChar item) throws DAOException {
    	HibernateProvider<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		facade.createQuery(DELETE_NOALLOWEDID);
		facade.setInt(0, item.getNoAllowedId());
		try{
			return facade.executeUpdate();
		}catch(HibernateException e){
			throw new DAOException(e);
		}
	}

	public int delete(List<Integer> ids) throws DAOException {
    	HibernateProvider<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		facade.createQuery(DELETES_NOALLOWEDID);
		facade.setParameterList("ids",ids);
		try{
			return facade.executeUpdate();
		}catch(HibernateException e){
			throw new DAOException(e);
		}
	}

	public NoAllowedChar findById(int id) {
		NoAllowedChar item = null;

        return item;
	}

	public List<NoAllowedChar> findByParameter(BaseParameter param) {
        List<NoAllowedChar> list = null;

		return list;
	}

	public long countByParameter(BaseParameter param) {
		return 0;
	}

	public List<NoAllowedChar> findAll(BaseParameter param) {
		HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
    	facade.createQuery(FIND_ALL);
		return facade.executeQuery();  
	}

	public long countAll(BaseParameter param) {
		return 0;
	}
	
	public NoAllowedChar findOnly() {
		NoAllowedChar item = null;
		HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
    	facade.createQuery(FIND_ALL);
        facade.setMaxResults(1);
        item = (NoAllowedChar) facade.uniqueResult();
		return item;
	}
}

⌨️ 快捷键说明

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