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

📄 update.template

📁 这个代码生成工具是针对java command framework(简称jcf)快速生成增删改查代码
💻 TEMPLATE
字号:
package #commandPackagePath#;

import java.util.Map;
import org.apache.log4j.Logger;
import com.gsta.eshore.framework.jcf.Command;
import com.gsta.eshore.framework.jcf.JCFException;
import #errorCodeClass#;
import #modelPackagePath#.#entityClass#;
import #daoPackagePath#.#daoClass#;

/**
 * @author He-WenQiang. Create in #dateTime#.
 *
 */

public class #commandClass# extends Command
{
	private static Logger logger=Logger.getLogger(#commandClass#.class);
	private #daoClass# dao;
	public void setDao(#daoClass# dao) {
		this.dao = dao;
	}

	public void execute(Map params, Map response) throws Exception
	{
		logger.debug("#commandClass# Command starting. ");
		#entityClass# #entityClassInstance# = (#entityClass#) params.get("#entityClassInstance#");
		if (check#entityClass#(#entityClassInstance#)) {
			String msg = "#commandClass# PARAM_ERR ,#entityClassInstance# is not validated!";
			throw new JCFException(ErrorCode.PARAM_ERR, msg);
		}
		
		try {
			dao.update(#entityClassInstance#);
			response.put("resultBoolean",Boolean.valueOf(true));
		} catch (Exception e) {
		    e.printStackTrace();
			response.put("resultBoolean",Boolean.valueOf(false));
			throw new JCFException(ErrorCode.DB_OP_ERR,"#commandClass#");
		}
		
	}

	private boolean check#entityClass#(#entityClass# #entityClassInstance#){
	     //print your code here;
		return false;
	}

	public void fini() throws JCFException
	{
		
	}

	public void init(String arg0) throws JCFException
	{
		logger.debug("DeleteFunctionById Command init. ");
	}


}

⌨️ 快捷键说明

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