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

📄 baseservice.java

📁 使用WEBWORK,SPRING,HIBERNATE编写的简单的添加
💻 JAVA
字号:
/**
 *文件功能: 
 */
package com.common.service;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.dao.DataAccessException;
import com.common.exception.BusinessException;
import com.common.util.PaginationSupport;
/**
 * @作者 徐建协
 * @日期 2008-1-12
 */
public interface BaseService<T, ID extends Serializable>{
	/********************
	 * 根据主键获取单个实体对象,如果返回null
	 * @param integer
	 * @return
	 */
	@SuppressWarnings("unchecked") 
	
	public T getEntity(ID  id) throws BusinessException;
	
	/********************
	 * 根据主键获取单个实体对象,
	 * @param id
	 * @return
	 */
	@SuppressWarnings("unchecked") 
	public T loadEntity(ID id) throws BusinessException;	
	/********************
	 * 保存单个实体对象
	 * @param entity
	 * @return
	 */
	public void saveEntity(T entity) throws BusinessException;
	/********************
	 * 批量保存实体对象
	 * @param entity
	 * @return
	 */
	public void saveEntity(T[] array) throws BusinessException;	
	/*******************************
	 * 更新单个实体对象
	 * @param entity
	 * @throws DataAccessException
	 */
	public void updateEntity(T entity) throws BusinessException;
	/*******************************
	 * 批量更新实体对象
	 * @param entity
	 * @throws DataAccessException
	 */
	public void updateEntity(T[] array) throws BusinessException;	
	
	/**************************
	 * 删除实体对象数据
	 * @param entity
	 */
	public void removeEntity(T entity) throws BusinessException;
	
	/**************
	 * 批量删除实体对象
	 * @param array
	 * @throws BusinessException
	 */
	public void removeEntity(T[] array) throws BusinessException;

	/*******************************
	 * 批量数据的更新或者删除
	 * @param hql
	 */
	/*******************
	 * 
	 * @param t
	 * @param names
	 * @return
	 * @throws BusinessException
	 */
	public boolean isExists(T t,List<String> names) throws BusinessException;



}

⌨️ 快捷键说明

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