コード例 #1
0
        // - - - - - - - - - -
        //             Execute
        //             - - - -
        protected void SetupOutsideSqlContextExecute(IMethodInvocation invocation)
        {
            Object[] args = invocation.Arguments;
            if (args.Length != 3)
            {
                String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.Length=" + args.Length;
                throw new SystemException(msg);
            }
            String            path              = GetOutsideSqlPath(args);
            Object            pmb               = GetOutsideSqlParameterBean(args);
            OutsideSqlOption  option            = GetOutsideSqlOption(args);
            OutsideSqlContext outsideSqlContext = new OutsideSqlContext();

            outsideSqlContext.IsDynamicBinding         = option.IsDynamicBinding;
            outsideSqlContext.IsOffsetByCursorForcedly = option.IsAutoPaging;
            outsideSqlContext.IsLimitByCursorForcedly  = option.IsAutoPaging;
            outsideSqlContext.OutsideSqlPath           = path;
            outsideSqlContext.ParameterBean            = pmb;
            outsideSqlContext.MethodName      = invocation.Method.Name;
            outsideSqlContext.StatementConfig = option.StatementConfig;
            outsideSqlContext.TableDbName     = option.TableDbName;
            outsideSqlContext.SetupBehaviorQueryPathIfNeeds();
            OutsideSqlContext.SetOutsideSqlContextOnThread(outsideSqlContext);

            // Set up fetchNarrowingBean.
            SetupOutsideSqlFetchNarrowingBean(pmb, option);
        }
コード例 #2
0
        public OutsideSqlPagingExecutor ManualPaging()
        {
            OutsideSqlOption option = CreateOutsideSqlOption();

            option.ManualPaging();
            return(new OutsideSqlPagingExecutor(_outsideSqlDao, option, _tableDbName));
        }
コード例 #3
0
        protected void SetupOutsideSqlContextSelect(IMethodInvocation invocation)
        {
            Object[] args = invocation.Arguments;
            if (args.Length != 4)
            {
                String msg = "Internal Error! OutsideSqlDao.selectXxx() should have 4 arguements: args.Length=" + args.Length;
                throw new SystemException(msg);
            }
            String            path              = GetOutsideSqlPath(args);
            Object            pmb               = GetOutsideSqlParameterBean(args);
            OutsideSqlOption  option            = GetOutsideSqlOption(args);
            Type              resultType        = args[3] is Type ? (Type)args[3] : args[3].GetType();
            bool              autoPagingLogging = (option.IsAutoPaging || option.IsSourcePagingRequestTypeAuto);
            OutsideSqlContext outsideSqlContext = new OutsideSqlContext();

            outsideSqlContext.OutsideSqlPath           = path;
            outsideSqlContext.ParameterBean            = pmb;
            outsideSqlContext.ResultType               = resultType;
            outsideSqlContext.MethodName               = invocation.Method.Name;
            outsideSqlContext.StatementConfig          = option.StatementConfig;
            outsideSqlContext.TableDbName              = option.TableDbName;
            outsideSqlContext.IsDynamicBinding         = option.IsDynamicBinding;
            outsideSqlContext.IsOffsetByCursorForcedly = option.IsAutoPaging;
            outsideSqlContext.IsLimitByCursorForcedly  = option.IsAutoPaging;
            outsideSqlContext.IsAutoPagingLogging      = autoPagingLogging; // for logging
            outsideSqlContext.SetupBehaviorQueryPathIfNeeds();
            OutsideSqlContext.SetOutsideSqlContextOnThread(outsideSqlContext);

            // Set up fetchNarrowingBean.
            SetupOutsideSqlFetchNarrowingBean(pmb, option);
        }
コード例 #4
0
        // -------------------------------------------------
        //                                            Helper
        //                                            ------
        protected OutsideSqlOption CreateOutsideSqlOption()
        {
            OutsideSqlOption option = new OutsideSqlOption();

            option.StatementConfig = _statementConfig;
            if (_dynamicBinding)
            {
                option.DynamicBinding();
            }
            option.TableDbName = _tableDbName;
            return(option);
        }
コード例 #5
0
        protected String GenerateSpecifiedOutsideSqlUniqueKey(IMethodInvocation invocation)
        {
            Object[]         args       = invocation.Arguments;
            String           path       = (String)args[0];
            Object           pmb        = args[1];
            OutsideSqlOption option     = (OutsideSqlOption)args[2];
            Type             resultType = null;

            if (args.Length > 3)
            {
                resultType = args[3] is Type ? (Type)args[3] : args[3].GetType();
            }
            return(OutsideSqlContext.GenerateSpecifiedOutsideSqlUniqueKey(invocation.Method.Name, path, pmb, option, resultType));
        }
コード例 #6
0
        protected void SetupOutsideSqlFetchNarrowingBean(Object pmb, OutsideSqlOption option)
        {
            if (pmb == null || !FetchNarrowingBeanContext.IsTheTypeFetchNarrowingBean(pmb.GetType()))
            {
                return;
            }
            FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean)pmb;

            if (option.IsManualPaging)
            {
                fetchNarrowingBean.IgnoreFetchNarrowing();
            }
            FetchNarrowingBeanContext.SetFetchNarrowingBeanOnThread(fetchNarrowingBean);
        }
コード例 #7
0
        public PagingResultBean <ENTITY> SelectPage <ENTITY>(String path, PagingBean pmb)
        {
            OutsideSqlOption countOption = _outsideSqlOption.CopyOptionWithoutPaging();
            OutsideSqlEntityExecutor <PagingBean> countExecutor
                = new OutsideSqlEntityExecutor <PagingBean>(_outsideSqlDao, countOption);
            DefaultPagingHandler <ENTITY> handler
                = new DefaultPagingHandler <ENTITY>(path, pmb, typeof(ENTITY), countExecutor, this, _tableDbName);
            PagingInvoker <ENTITY> invoker = new PagingInvoker <ENTITY>(_tableDbName);

            if (pmb.IsCountLater)
            {
                invoker.CountLater();
            }
            return(invoker.InvokePaging(handler));
        }
コード例 #8
0
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, OutsideSqlOption outsideSqlOption)
 {
     this._outsideSqlDao    = outsideSqlDao;
     this._outsideSqlOption = outsideSqlOption;
 }
コード例 #9
0
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, OutsideSqlOption outsideSqlOption)
 {
     this._outsideSqlDao    = outsideSqlDao;
     this._outsideSqlOption = outsideSqlOption;
 }
コード例 #10
0
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, OutsideSqlOption outsideSqlOption, String tableDbName)
 {
     this._outsideSqlDao    = outsideSqlDao;
     this._outsideSqlOption = outsideSqlOption;
     this._tableDbName      = tableDbName;
 }