Search in sources :

Example 1 with DeleteNonstrictEntityCommand

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

the class AbstractBehaviorWritable method createDeleteNonstrictEntityCommand.

protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand(Entity entity, DeleteOption<? extends ConditionBean> option) {
    assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand");
    final DeleteNonstrictEntityCommand cmd = newDeleteNonstrictEntityCommand();
    xsetupEntityCommand(cmd, entity);
    cmd.setDeleteOption(option);
    return cmd;
}
Also used : DeleteNonstrictEntityCommand(org.dbflute.bhv.core.command.DeleteNonstrictEntityCommand)

Example 2 with DeleteNonstrictEntityCommand

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

the class AbstractBehaviorWritable method delegateDeleteNonstrict.

protected int delegateDeleteNonstrict(Entity entity, DeleteOption<? extends ConditionBean> option) {
    final OptionalThing<DeleteOption<? extends ConditionBean>> optOption = createOptionalDeleteOption(option);
    adjustEntityBeforeDelete(entity, optOption);
    final DeleteNonstrictEntityCommand command = createDeleteNonstrictEntityCommand(entity, option);
    final OptionalThing<Object> optEntity = OptionalThing.of(entity);
    RuntimeException cause = null;
    try {
        hookBeforeDelete(command, optEntity, emptyOpt(), optOption);
        return invoke(command);
    } catch (RuntimeException e) {
        cause = e;
        throw e;
    } finally {
        hookFinallyDelete(command, optEntity, emptyOpt(), optOption, createOptionalCause(cause));
    }
}
Also used : DeleteNonstrictEntityCommand(org.dbflute.bhv.core.command.DeleteNonstrictEntityCommand) DeleteOption(org.dbflute.bhv.writable.DeleteOption) ConditionBean(org.dbflute.cbean.ConditionBean)

Aggregations

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