zoukankan      html  css  js  c++  java
  • ADF代码运行和调试AM

    ADF自带了一个TestClient用来调试和运行AM的程序,但修改AM代码后要重新启动TestClient,效率不高。这里介绍一种使用代码运行AM的方法,代码如下:

    import model.common.AppModule;
    
    import model.queries.DeptVOImpl;
    import model.queries.EmpVOImpl;
    
    import model.queries.EmpVORowImpl;
    
    import oracle.jbo.Row;;
    import oracle.jbo.server.ApplicationModuleImpl;
    import oracle.jbo.client.Configuration;
    // ---------------------------------------------------------------------
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Sat Feb 15 15:46:55 CST 2014
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    // ---------------------------------------------------------------------
    public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {
        /**
         * This is the default constructor (do not remove).
         */
        public AppModuleImpl() {
        }
    
        /**
         * Container's getter for EmpVO1.
         * @return EmpVO1
         */
        public EmpVOImpl getEmpVO1() {
            return (EmpVOImpl)findViewObject("EmpVO1");
        }
    
        /**
         * Container's getter for DeptVO1.
         * @return DeptVO1
         */
        public DeptVOImpl getDeptVO1() {
            return (DeptVOImpl)findViewObject("DeptVO1");
        }
    
        public void test() {
            EmpVOImpl vo = this.getEmpVO1();
            vo.executeQuery();
            while (vo.hasNext()) {
                Row rt = (EmpVORowImpl)vo.next();
                String LastName = (String)rt.getAttribute("LastName");
                System.out.println("LastName:" + LastName);
            }
        }
        //添加main方法
        public static void main(String[] cmd) {
            String amDef = "model.AppModule";
            String config = "AppModuleLocal";
            AppModuleImpl am =
                (AppModuleImpl)Configuration.createRootApplicationModule(amDef,
                                                                         config);
            am.test();
            Configuration.releaseRootApplicationModule(am, true);
        }
    }

    其中amDef和config的值可以在bc4j.xcfg找到,分别是ApplicationName属性和name属性的值。

  • 相关阅读:
    转linux ln命令详解 简单
    商业智能哲学思索
    IE8 RTM 和 IE8 RC1 版本比较。
    汇编语言发展树.
    IE8卸载后遗症,不得不继续当小白鼠。。。
    商务智能系统实现数据管理的关键技术
    商务智能 是什么? 不是什么?
    Standard and Custom Toolset Configurations
    统一论:3G手机、云计算、SaaS、业务开发平台、SOA、BPEL [转]
    JAVA Atm测试实验心得
  • 原文地址:https://www.cnblogs.com/weisuoc/p/3551670.html
Copyright © 2011-2022 走看看