Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  * either express or implied. See the License for the specific language
  * governing permissions and limitations under the License.
  */
 package org.dbflute.bhv.core.command;
 
 import java.util.Map;
 
The abstract command for OutsideSql.selectSomething().

Parameters:
<RESULT> The type of result.
Author(s):
jflute
 
 public abstract class AbstractOutsideSqlSelectCommand<RESULT> extends AbstractOutsideSqlCommand<RESULT> {
 
     // ===================================================================================
     //                                                                  Detail Information
     //                                                                  ==================
     public boolean isProcedure() {
         return false;
     }
 
     public boolean isSelect() {
         return true;
     }
 
     // ===================================================================================
     //                                                                    Process Callback
     //                                                                    ================
     public void beforeGettingSqlExecution() {
         assertStatus("beforeGettingSqlExecution");
         OutsideSqlContext.setOutsideSqlContextOnThread(createOutsideSqlContext());
 
         // set up fetchNarrowingBean
         final Object pmb = ;
         final OutsideSqlOption option = ;
         setupFetchBean(pmboption);
     }
 
     @Override
     protected void setupOutsideSqlContextProperty(OutsideSqlContext outsideSqlContext) {
         super.setupOutsideSqlContextProperty(outsideSqlContext);
         final OutsideSqlOption option = ;
         final boolean autoPagingLogging = (option.isAutoPaging() || option.isSourcePagingRequestTypeAuto());
         outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for logging
     }
 
     protected void setupFetchBean(Object pmbOutsideSqlOption option) {
         if (pmb == null) {
             return;
         }
         if (pmb instanceof FetchBean) {
             FetchAssistContext.setFetchBeanOnThread((FetchBeanpmb);
             if (pmb instanceof FetchNarrowingBean && option.isManualPaging()) {
                 ((FetchNarrowingBeanpmb).xdisableFetchNarrowing();
             }
         }
     }
 
     public void afterExecuting() {
     }
 
     // ===================================================================================
     //                                                               SqlExecution Handling
     //                                                               =====================
     public String buildSqlExecutionKey() {
         assertStatus("buildSqlExecutionKey");
         return generateSpecifiedOutsideSqlUniqueKey();
     }
 
         final String methodName = getCommandName();
         final String path = ;
         final Object pmb = ;
         final OutsideSqlOption option = ;
         final Class<?> resultType = getResultType();
         return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey(methodNamepathpmboptionresultType);
     }
        assertStatus("createSqlExecutionCreator");
        return new SqlExecutionCreator() {
            public SqlExecution createSqlExecution() {
                final OutsideSqlContext outsideSqlContext = OutsideSqlContext.getOutsideSqlContextOnThread();
                return createOutsideSqlSelectExecution(outsideSqlContext);
            }
        };
    }
    protected SqlExecution createOutsideSqlSelectExecution(OutsideSqlContext outsideSqlContext) {
        // - - - - - - - - - - - - - - - - - - - - - - -
        // The attribute of Specified-OutsideSqlContext.
        // - - - - - - - - - - - - - - - - - - - - - - -
        final Object pmb = outsideSqlContext.getParameterBean();
        final String suffix = buildDbmsSuffix();
        final String sql = outsideSqlContext.readFilteredOutsideSql(suffix);
        // - - - - - - - - - - - - -
        // Create ResultSetHandler.
        // - - - - - - - - - - - - -
        final TnResultSetHandler handler = createOutsideSqlSelectResultSetHandler();
        // - - - - - - - - - - -
        // Create SqlExecution.
        // - - - - - - - - - - -
        final OutsideSqlSelectExecution execution = createOutsideSqlSelectExecution(pmbsqlhandler);
        execution.setRemoveBlockComment(isRemoveBlockComment(outsideSqlContext));
        execution.setRemoveLineComment(isRemoveLineComment(outsideSqlContext));
        execution.setFormatSql(outsideSqlContext.isFormatSql());
        execution.setOutsideSqlFilter();
        return execution;
    }
        final Map<StringClass<?>> argNameTypeMap = createBeanArgNameTypeMap(pmbTypeObj);
        return newOutsideSqlSelectExecution(argNameTypeMapsqlhandler);
    }
    protected OutsideSqlSelectExecution newOutsideSqlSelectExecution(Map<StringClass<?>> argNameTypeMapString sql,
            TnResultSetHandler handler) {
        return new OutsideSqlSelectExecution(argNameTypeMapsqlhandler);
    }
    public Object[] getSqlExecutionArgument() {
        assertStatus("getSqlExecutionArgument");
        return new Object[] {  };
    }
    // ===================================================================================
    //                                                                       Assert Helper
    //                                                                       =============
    protected void assertStatus(String methodName) {
        assertBasicProperty(methodName);
        assertComponentProperty(methodName);
        assertOutsideSqlBasic(methodName);
    }
New to GrepCode? Check out our FAQ X