Search in sources :

Example 1 with QueryDeleteCBCommand

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

Example 2 with QueryDeleteCBCommand

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

the class AbstractBehaviorWritable method createQueryDeleteCBCommand.

protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb, DeleteOption<? extends ConditionBean> option) {
    assertBehaviorCommandInvoker("createQueryDeleteCBCommand");
    final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand();
    cmd.setTableDbName(asTableDbName());
    _behaviorCommandInvoker.injectComponentProperty(cmd);
    cmd.setConditionBean(cb);
    cmd.setDeleteOption(option);
    return cmd;
}
Also used : QueryDeleteCBCommand(org.dbflute.bhv.core.command.QueryDeleteCBCommand)

Aggregations

QueryDeleteCBCommand (org.dbflute.bhv.core.command.QueryDeleteCBCommand)2 DeleteOption (org.dbflute.bhv.writable.DeleteOption)1 ConditionBean (org.dbflute.cbean.ConditionBean)1