noallowedcharimpl.java

来自「详细的建站源码 详细的建站源码 详细的建站源码 详细的建站源码」· Java 代码 · 共 92 行

JAVA
92
字号
/* 
 * Created on 2006-2-25
 * Last modified on 2007-1-21
 * Powered by YeQiangWei.com
 */
package com.yeqiangwei.club.dao.hibernate.impl;

import java.util.List;

import com.yeqiangwei.club.dao.NoAllowedCharDAO;
import com.yeqiangwei.club.dao.hibernate.support.HibernateFacade;
import com.yeqiangwei.club.dao.model.NoAllowedChar;
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 NoAllowedChar create(NoAllowedChar item) {
		HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		item = facade.save(item);		
		return item;
	}

	public NoAllowedChar update(NoAllowedChar item) {
        HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
        item = facade.update(item);
        return item;
	}

	public int delete(NoAllowedChar item) {
    	HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		facade.createQuery(DELETE_NOALLOWEDID);
		facade.setInt(0, item.getNoAllowedId());
		int c = facade.executeUpdate();
		return c;
	}

	public int delete(List ids) {
		HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
		facade.createQuery(DELETES_NOALLOWEDID);
		facade.setParameterList("ids", ids);
		int c = facade.executeUpdate();
		return c;
	}

	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 findAll(BaseParameter param) {
        List list = null;
		HibernateFacade<NoAllowedChar> facade = new HibernateFacade<NoAllowedChar>();
    	facade.createQuery(FIND_ALL);
        list = facade.executeQuery();  
		return list;
	}

	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 + =
减小字号Ctrl + -
显示快捷键?