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

📄 picturehelper.java

📁 一个免费wap站
💻 JAVA
字号:
package com.eline.wap.resource.client;

import com.eline.wap.common.model.Page;
import com.eline.wap.resource.dao.PictureDAO;
import com.eline.wap.resource.dao.ResourceDAOFactory;
import com.eline.wap.resource.exceptions.ResourceDAOSysException;
import com.eline.wap.resource.exceptions.ResourceException;
import com.eline.wap.resource.model.Picture;
import com.eline.wap.resource.model.PictureCondition;

public class PictureHelper {

	private PictureDAO dao = null;

	public Page searchPictures(PictureCondition condition, int start, int count) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getPictureDAO();
			return dao.searchPictures(condition, start, count);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	
	public void createPicture(Picture item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getPictureDAO();
			dao.createPicture(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	
	public void updatePicture(Picture item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getPictureDAO();
			dao.updatePicture(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}

	public void deletePicture(int pictureId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getPictureDAO();
			dao.deletePicture(pictureId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}

	public Picture getPicture(int pictureId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getPictureDAO();
			return dao.getPicture(pictureId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}

}

⌨️ 快捷键说明

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