Search in sources :

Example 36 with ConditionBean

use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.

the class QueryDerivedReferrer method buildRightClauseDreamCruiseExp.

protected void buildRightClauseDreamCruiseExp(StringBuilder sb) {
    final SpecifiedColumn specifiedColumn = (SpecifiedColumn) _value;
    final String columnExp = specifiedColumn.toColumnRealName().toString();
    final String appended;
    if (specifiedColumn.hasSpecifyCalculation()) {
        specifiedColumn.xinitSpecifyCalculation();
        final HpCalcSpecification<ConditionBean> calcSpecification = specifiedColumn.getSpecifyCalculation();
        appended = calcSpecification.buildStatementToSpecifidName(columnExp);
    } else {
        appended = columnExp;
    }
    sb.append(appended);
}
Also used : SpecifiedColumn(org.dbflute.cbean.dream.SpecifiedColumn) ConditionBean(org.dbflute.cbean.ConditionBean)

Example 37 with ConditionBean

use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.

the class SelectCursorCBCommand method beforeGettingSqlExecution.

// ===================================================================================
// Process Callback
// ================
public void beforeGettingSqlExecution() {
    assertStatus("beforeGettingSqlExecution");
    final ConditionBean cb = _conditionBean;
    FetchAssistContext.setFetchBeanOnThread(cb);
    ConditionBeanContext.setConditionBeanOnThread(cb);
    ConditionBeanContext.setEntityRowHandlerOnThread(_entityRowHandler);
}
Also used : ConditionBean(org.dbflute.cbean.ConditionBean)

Example 38 with ConditionBean

use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.

the class ContextStack method restoreAllContextOnThreadIfExists.

public static void restoreAllContextOnThreadIfExists() {
    if (!isExistContextStackOnThread()) {
        return;
    }
    final Stack<ContextStack> stackOnThread = getContextStackOnThread();
    if (stackOnThread.isEmpty()) {
        clearContextStackOnThread();
        return;
    }
    final ContextStack contextStack = stackOnThread.pop();
    final ConditionBean cb = contextStack.getConditionBean();
    if (cb != null) {
        ConditionBeanContext.setConditionBeanOnThread(cb);
    }
    final EntityRowHandler<? extends Entity> entityRowHandler = contextStack.getEntityRowHandler();
    if (entityRowHandler != null) {
        ConditionBeanContext.setEntityRowHandlerOnThread(entityRowHandler);
    }
    final OutsideSqlContext outsideSqlContext = contextStack.getOutsideSqlContext();
    if (outsideSqlContext != null) {
        OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext);
    }
    final FetchBean fetchBean = contextStack.getFetchBean();
    if (fetchBean != null) {
        FetchAssistContext.setFetchBeanOnThread(fetchBean);
    }
    final Map<String, Object> internalMap = contextStack.getInternalMap();
    if (internalMap != null) {
        InternalMapContext.clearInternalMapContextOnThread();
        final Set<Entry<String, Object>> entrySet = internalMap.entrySet();
        for (Entry<String, Object> entry : entrySet) {
            InternalMapContext.setObject(entry.getKey(), entry.getValue());
        }
    }
    final ResourceContext resourceContext = contextStack.getResourceContext();
    if (resourceContext != null) {
        ResourceContext.setResourceContextOnThread(resourceContext);
    }
}
Also used : FetchBean(org.dbflute.jdbc.FetchBean) ConditionBean(org.dbflute.cbean.ConditionBean) Entry(java.util.Map.Entry) OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext)

Example 39 with ConditionBean

use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.

the class SelectCountCBCommand method afterExecuting.

public void afterExecuting() {
    assertStatus("afterExecuting");
    final ConditionBean cb = _conditionBean;
    cb.xafterCareSelectCountIgnoreFetchScope();
}
Also used : ConditionBean(org.dbflute.cbean.ConditionBean)

Example 40 with ConditionBean

use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.

the class SelectCBExecution method extractConditionBean.

// -----------------------------------------------------
// Argument Handling
// -----------------
protected ConditionBean extractConditionBean(Object[] args) {
    assertArgsValid(args);
    final Object firstElement = args[0];
    assertObjectNotNull("args[0]", firstElement);
    assertFirstElementConditionBean(firstElement);
    final ConditionBean cb = (ConditionBean) firstElement;
    return cb;
}
Also used : ConditionBean(org.dbflute.cbean.ConditionBean)

Aggregations

ConditionBean (org.dbflute.cbean.ConditionBean)45 DeleteOption (org.dbflute.bhv.writable.DeleteOption)7 UpdateOption (org.dbflute.bhv.writable.UpdateOption)7 ArrayList (java.util.ArrayList)5 InsertOption (org.dbflute.bhv.writable.InsertOption)5 Entity (org.dbflute.Entity)4 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)4 List (java.util.List)3 AbstractBatchUpdateCommand (org.dbflute.bhv.core.command.AbstractBatchUpdateCommand)3 BatchDeleteCommand (org.dbflute.bhv.core.command.BatchDeleteCommand)3 BatchDeleteNonstrictCommand (org.dbflute.bhv.core.command.BatchDeleteNonstrictCommand)3 BatchInsertCommand (org.dbflute.bhv.core.command.BatchInsertCommand)3 BatchUpdateCommand (org.dbflute.bhv.core.command.BatchUpdateCommand)3 BatchUpdateNonstrictCommand (org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand)3 DeleteEntityCommand (org.dbflute.bhv.core.command.DeleteEntityCommand)3 DeleteNonstrictEntityCommand (org.dbflute.bhv.core.command.DeleteNonstrictEntityCommand)3 InsertEntityCommand (org.dbflute.bhv.core.command.InsertEntityCommand)3 QueryDeleteCBCommand (org.dbflute.bhv.core.command.QueryDeleteCBCommand)3 QueryInsertCBCommand (org.dbflute.bhv.core.command.QueryInsertCBCommand)3 QueryUpdateCBCommand (org.dbflute.bhv.core.command.QueryUpdateCBCommand)3