Search in sources :

Example 1 with QueryUpdateCBCommand

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

the class AbstractBehaviorWritable method delegateQueryUpdate.

protected int delegateQueryUpdate(Entity entity, ConditionBean cb, UpdateOption<? extends ConditionBean> option) {
    final OptionalThing<UpdateOption<? extends ConditionBean>> optOption = createOptionalUpdateOption(option);
    adjustEntityBeforeQueryUpdate(entity, cb, optOption);
    final QueryUpdateCBCommand command = createQueryUpdateCBCommand(entity, cb, option);
    final OptionalThing<ConditionBean> optCB = OptionalThing.of(cb);
    RuntimeException cause = null;
    try {
        hookBeforeUpdate(command, entity, optCB, optOption);
        return invoke(command);
    } catch (RuntimeException e) {
        cause = e;
        throw e;
    } finally {
        hookFinallyUpdate(command, entity, optCB, optOption, createOptionalCause(cause));
    }
}
Also used : QueryUpdateCBCommand(org.dbflute.bhv.core.command.QueryUpdateCBCommand) UpdateOption(org.dbflute.bhv.writable.UpdateOption) ConditionBean(org.dbflute.cbean.ConditionBean)

Example 2 with QueryUpdateCBCommand

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

the class AbstractBehaviorWritable method createQueryUpdateCBCommand.

protected QueryUpdateCBCommand createQueryUpdateCBCommand(Entity entity, ConditionBean cb, UpdateOption<? extends ConditionBean> option) {
    assertBehaviorCommandInvoker("createQueryUpdateCBCommand");
    final QueryUpdateCBCommand cmd = new QueryUpdateCBCommand();
    cmd.setTableDbName(asTableDbName());
    _behaviorCommandInvoker.injectComponentProperty(cmd);
    cmd.setEntity(entity);
    cmd.setConditionBean(cb);
    cmd.setUpdateOption(option);
    return cmd;
}
Also used : QueryUpdateCBCommand(org.dbflute.bhv.core.command.QueryUpdateCBCommand)

Aggregations

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