kjavahelper.java

来自「一个免费wap站」· Java 代码 · 共 107 行

JAVA
107
字号
package com.eline.wap.resource.client;

import com.eline.wap.common.model.Page;
import com.eline.wap.resource.dao.KJavaDAO;
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.KJava;
import com.eline.wap.resource.model.KJavaCondition;
import com.eline.wap.resource.model.KJavaStorage;

public class KJavaHelper {

	private KJavaDAO dao = null;

	public Page searchKJavas(KJavaCondition condition, int start, int count) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			return dao.searchKJavas(condition, start, count);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void updateKJava(KJava item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.updateKJava(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void deleteKJava(int indexId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.deleteKJava(indexId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void createKJava(KJava item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.createKJava(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public KJava getKJava(int indexId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			return dao.getKJava(indexId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public Page getKJavaStorages(int parentId, int start, int count) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			return dao.getKJavaStorages(parentId, start, count);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public KJavaStorage getKJavaStorage(int indexId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			return dao.getKJavaStorage(indexId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void createKJavaStorage(KJavaStorage item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.createKJavaStorage(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void updateKJavaStorage(KJavaStorage item) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.updateKJavaStorage(item);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
	public void deleteKJavaStorage(int indexId) throws ResourceException {
		try {
			if (dao == null)
				dao = ResourceDAOFactory.getKJavaDAO();
			dao.deleteKJavaStorage(indexId);
		} catch (ResourceDAOSysException e) {
			throw new ResourceException(e.getMessage());
		}
	}
}

⌨️ 快捷键说明

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