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;
}
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));
}
}
Aggregations