BaseAction 和继承类的应用
import java.util.HashMap;import java.util.Map;import com.auto.entity.Roleinfo;import com.auto.service.BaseService;public class RoleinfoAction extends BaseAction{private static final long serialVersionUID = -128991403689032079L;private Roleinfo info;public String find(){if(null != info){info = new BaseService<Roleinfo>().query(info);}return SUCCESS;}@SuppressWarnings("unchecked")public String list(){ Map map = null; if (null != info) { map = new HashMap(); map.put("Operatorid", info.getOperatorid()); }queryPageList("Roleinfo", BaseService.class, Roleinfo.class, map);return SUCCESS;}public String insert() throws Exception{try { return new BaseService<Roleinfo>().insert(info) ? ADDSUCCESS : ADDFAILED; } catch (Exception e) { throw e; }}public String modify() throws Exception{ try { if (null != info) { new BaseService<Roleinfo>().update(info); } return ADDSUCCESS; } catch (Exception e) { throw e; }}public String delete() throws Exception { try { deleteByStrings(Roleinfo.class); return ADDSUCCESS; } catch (Exception e) { throw e; } }public Roleinfo getInfo() { return info; } public void setInfo(Roleinfo info) { this.info = info; }}
?