首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

BaseAction 跟继承类的应用

2012-10-15 
BaseAction 和继承类的应用import java.util.HashMapimport java.util.Mapimport com.auto.entity.Rolei

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;    }}

?

热点排行