📄 findbyid.template
字号:
package #commandPackagePath#;
import java.util.Map;
import org.apache.log4j.Logger;
import com.gsta.eshore.framework.jcf.Command;
import #errorCodeClass#;
import com.gsta.eshore.framework.jcf.JCFException;
import #daoPackagePath#.#daoClass#;
import #modelPackagePath#.#entityClass#;
/**
* @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. ");
String #primaryKeyInstance# = (String) params.get("#primaryKeyInstance#");
try {
#entityClass# #entityClassInstance# = (#entityClass#)dao.getById(#entityClass#.class, #primaryKeyInstance#);
response.put("#entityClassInstance#",#entityClassInstance#);
} catch (Exception e) {
e.printStackTrace();
throw new JCFException(ErrorCode.DB_OP_ERR,"#commandClass#");
}
}
public void fini() throws JCFException
{
}
public void init(String arg0) throws JCFException
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -