use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class SelectScalarCBCommand method beforeGettingSqlExecution.
// ===================================================================================
// Process Callback
// ================
public void beforeGettingSqlExecution() {
assertStatus("beforeGettingSqlExecution");
final ConditionBean cb = _conditionBean;
ConditionBeanContext.setConditionBeanOnThread(cb);
// *Point!
cb.getSqlClause().classifySelectClauseType(_selectClauseType);
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class ManualOrderOption method resolveDreamCruiseExp.
protected Object resolveDreamCruiseExp(Object plainValue) {
final SpecifiedColumn specifiedColumn = (SpecifiedColumn) plainValue;
final String columnExp = specifiedColumn.toColumnRealName().toString();
if (specifiedColumn.hasSpecifyCalculation()) {
specifiedColumn.xinitSpecifyCalculation();
final HpCalcSpecification<ConditionBean> calcSpecification = specifiedColumn.getSpecifyCalculation();
return calcSpecification.buildStatementToSpecifidName(columnExp);
}
return columnExp;
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class ConditionKey method resolveCalculationColumn.
protected ColumnRealName resolveCalculationColumn(ColumnRealName columnRealName, ConditionOption option) {
if (option == null) {
return columnRealName;
}
if (option instanceof RangeOfOption) {
final RangeOfOption rangeOfOption = (RangeOfOption) option;
if (rangeOfOption.hasCalculationRange()) {
final HpCalcSpecification<ConditionBean> calculationRange = rangeOfOption.getCalculationRange();
final String calculated = calculationRange.buildStatementToSpecifidName(columnRealName.toString());
return toColumnRealName(calculated);
}
}
return columnRealName;
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateBatchUpdateNonstrict.
protected int[] delegateBatchUpdateNonstrict(List<? extends Entity> entityList, UpdateOption<? extends ConditionBean> option) {
if (entityList.isEmpty()) {
return EMPTY_INT_ARRAY;
}
final OptionalThing<UpdateOption<? extends ConditionBean>> optOption = createOptionalUpdateOption(option);
adjustEntityListBeforeBatchUpdate(entityList, option, true);
if (entityList.isEmpty()) {
// might be filtered
return EMPTY_INT_ARRAY;
}
final BatchUpdateNonstrictCommand command = createBatchUpdateNonstrictCommand(entityList, option);
RuntimeException cause = null;
try {
hookBeforeUpdate(command, entityList, emptyOpt(), optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyUpdate(command, entityList, emptyOpt(), optOption, createOptionalCause(cause));
}
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateQueryDelete.
protected int delegateQueryDelete(ConditionBean cb, DeleteOption<? extends ConditionBean> option) {
final OptionalThing<DeleteOption<? extends ConditionBean>> optOption = createOptionalDeleteOption(option);
adjustEntityBeforeQueryDelete(cb, optOption);
final QueryDeleteCBCommand command = createQueryDeleteCBCommand(cb, option);
final OptionalThing<ConditionBean> optCB = OptionalThing.of(cb);
RuntimeException cause = null;
try {
hookBeforeDelete(command, emptyOpt(), optCB, optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyDelete(command, emptyOpt(), optCB, optOption, createOptionalCause(cause));
}
}
Aggregations