Search in sources :

Example 1 with BatchUpdateNonstrictCommand

use of org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand 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));
    }
}
Also used : BatchUpdateNonstrictCommand(org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand) UpdateOption(org.dbflute.bhv.writable.UpdateOption) ConditionBean(org.dbflute.cbean.ConditionBean)

Example 2 with BatchUpdateNonstrictCommand

use of org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand in project dbflute-core by dbflute.

the class AbstractBehaviorWritable method createBatchUpdateNonstrictCommand.

protected BatchUpdateNonstrictCommand createBatchUpdateNonstrictCommand(List<? extends Entity> entityList, UpdateOption<? extends ConditionBean> option) {
    assertBehaviorCommandInvoker("createBatchUpdateNonstrictCommand");
    final BatchUpdateNonstrictCommand cmd = newBatchUpdateNonstrictCommand();
    setupListEntityCommand(cmd, entityList);
    cmd.setUpdateOption(option);
    return cmd;
}
Also used : BatchUpdateNonstrictCommand(org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand)

Aggregations

BatchUpdateNonstrictCommand (org.dbflute.bhv.core.command.BatchUpdateNonstrictCommand)2 UpdateOption (org.dbflute.bhv.writable.UpdateOption)1 ConditionBean (org.dbflute.cbean.ConditionBean)1