fundaccountdelegate.java

来自「EJB+Struts+Webservice实现的开放式基金管理系统」· Java 代码 · 共 134 行

JAVA
134
字号
package com.fund.client;

import com.fund.ServiceLocator;
import com.fund.ServiceLocatorException;

/**
 *
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class FundAccountDelegate {
    /**
     * fundAccountSessionFacadeHome
     */
    private FundAccountSessionFacadeHome fundAccountSessionFacadeHome;
    /**
     * fundAccountSessionFacade
     */
    private FundAccountSessionFacade fundAccountSessionFacade;
    /**
     *
     * @throws Exception e
     */
    public FundAccountDelegate() throws Exception {
        initializeFundAccountSessionFacadeHome();
        fundAccountSessionFacade = fundAccountSessionFacadeHome.create();
    }

    /**
     *
     * @param fundAccountDto FundAccountDto
     * @return Integer
     * @throws Exception e
     */
    public Integer createFundAccount(FundAccountDto fundAccountDto) throws
            Exception {
        return fundAccountSessionFacade.createFundAccount(fundAccountDto);
    }

    /**
     *
     * @param fundAccNo Integer
     * @throws Exception e
     */
    public void removeFundAccount(Integer fundAccNo) throws Exception {
        fundAccountSessionFacade.removeFundAccount(fundAccNo);
    }

    /**
     *
     * @param fundAccountDto FundAccountDto
     * @throws Exception e
     */
    public void removeFundAccount(FundAccountDto fundAccountDto) throws
            Exception {
        fundAccountSessionFacade.removeFundAccount(fundAccountDto);
    }

    /**
     *
     * @param fundAccountDto FundAccountDto
     * @throws Exception e
     */
    public void updateFundAccount(FundAccountDto fundAccountDto) throws
            Exception {
        fundAccountSessionFacade.updateFundAccount(fundAccountDto);
    }

    /**
     *
     * @param fundAccountDtos FundAccountDto[]
     * @throws Exception e
     */
    public void updateFundAccounts(FundAccountDto[] fundAccountDtos) throws
            Exception {
        fundAccountSessionFacade.updateFundAccounts(fundAccountDtos);
    }

    /**
     *
     * @param fundAccNo Integer
     * @return FundAccountDto
     * @throws Exception e
     */
    public FundAccountDto fundAccountFindByPrimaryKey(Integer fundAccNo)
            throws
            Exception {
        return fundAccountSessionFacade.fundAccountFindByPrimaryKey(fundAccNo);
    }

    /**
     *
     * @param financialAccNo Integer
     * @return FundAccountDto[]
     * @throws Exception e
     */
    public FundAccountDto[] fundAccountFindByFundAccNo(Integer financialAccNo)
            throws
            Exception {
        return fundAccountSessionFacade.fundAccountFindByFinancialAccNo(
                financialAccNo);
    }

    /**
     *
     * @throws Exception e
     */
    private void initializeFundAccountSessionFacadeHome() throws Exception {
        String facadeName = "FundAccountSessionFacade";
        Class facadeClass = com.fund.client.FundAccountSessionFacadeHome.class;
        if (fundAccountSessionFacadeHome == null) {
            try {
                ServiceLocator locator = ServiceLocator.getInstance();
                fundAccountSessionFacadeHome = (FundAccountSessionFacadeHome)
                                               locator.getEjbHome(facadeName,
                        facadeClass);
                if (fundAccountSessionFacadeHome == null) {
                    throw new Exception("Did not get home for " + facadeName);
                }
            } catch (ServiceLocatorException e) {
                throw new Exception(e.getMessage());
            }
        }
    }
}

⌨️ 快捷键说明

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