1. Bean 基类

    com.ailk.biz.bean.BizBean 结构图及 API

    /**
     * 根据 subsys.default 创建默认的 DAO
     * @param clazz
     * @return
     * @throws Exception
     */
    public static <Type extends IBaseDAO> Type createDAO(Class<Type> clazz) throws Exception
    
    /**
     * 根据 subsys.group+eparchyId 创建 DAO
     * @param clazz
     * @param routeId
     * @return
     * @throws Exception
     */
    public static <Type extends IBaseDAO> Type createDAO(Class<Type> clazz, String routeId) throws Exception
    
    /**
     * get visit();
     * @return
     * @throws Exception
     */
    public static BizVisit getVisit() throws Exception 
    
    
    /**
     * reate data input
     * @param params
     * @return
     */
    public static IDataInput createDataInput() throws Exception 
    
    
    /**
     * create data input
     * @param params
     * @param pagin
     * @return
     */
    public static IDataInput createDataInput(IData params) throws Exception 
    
    /**
     * create data input
     * @param params
     * @param pagin
     * @return
     */
    public static IDataInput createDataInput(IData params, Pagination pagination) throws Exception
    

    示例代码:

    public class CustBean extends BizBean {
    	/**
    	 * query custs
    	 * @param param
    	 * @return
    	 * @throws Exception
    	 */
    	public IDataset queryCusts(IData param) throws Exception {
    		CustDAO dao = createDAO(CustDAO.class);
    		return dao.queryCusts(param);
    	}
    	
    	
    	/**
    	 * update cust name
    	 * @param cust
    	 * @return
    	 * @throws Exception
    	 */
    	public boolean updateCustName(IData cust) throws Exception {
    		CustDAO dao = createDAO(CustDAO.class,getVisit().getStaffEparchyCode());
    		return dao.save("tf_f_cust_vip", cust, new String[] {"VIP_ID", "CUST_ID"});
    	}
    }