use of org.dbflute.bhv.core.command.QueryInsertCBCommand in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateQueryInsert.
// -----------------------------------------------------
// Query Update
// ------------
protected int delegateQueryInsert(Entity entity, ConditionBean inCB, ConditionBean resCB, InsertOption<? extends ConditionBean> option) {
final OptionalThing<InsertOption<? extends ConditionBean>> optOption = createOptionalInsertOption(option);
adjustEntityBeforeQueryInsert(entity, inCB, resCB, optOption);
final QueryInsertCBCommand command = createQueryInsertCBCommand(entity, inCB, resCB, option);
final OptionalThing<ConditionBean> optInCB = OptionalThing.of(inCB);
RuntimeException cause = null;
try {
hookBeforeInsert(command, entity, optInCB, optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyInsert(command, entity, optInCB, optOption, createOptionalCause(cause));
}
}
use of org.dbflute.bhv.core.command.QueryInsertCBCommand in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method createQueryInsertCBCommand.
// -----------------------------------------------------
// Query
// -----
protected QueryInsertCBCommand createQueryInsertCBCommand(Entity entity, ConditionBean intoCB, ConditionBean resourceCB, InsertOption<? extends ConditionBean> option) {
assertBehaviorCommandInvoker("createQueryInsertCBCommand");
final QueryInsertCBCommand cmd = new QueryInsertCBCommand();
cmd.setTableDbName(asTableDbName());
_behaviorCommandInvoker.injectComponentProperty(cmd);
cmd.setEntity(entity);
cmd.setIntoConditionBean(intoCB);
cmd.setConditionBean(resourceCB);
cmd.setInsertOption(option);
return cmd;
}
Aggregations