use of org.dbflute.bhv.core.command.BatchInsertCommand in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method createBatchInsertCommand.
// -----------------------------------------------------
// Batch
// -----
protected BatchInsertCommand createBatchInsertCommand(List<? extends Entity> entityList, InsertOption<? extends ConditionBean> option) {
assertBehaviorCommandInvoker("createBatchInsertCommand");
final BatchInsertCommand cmd = newBatchInsertCommand();
setupListEntityCommand(cmd, entityList);
cmd.setInsertOption(option);
return cmd;
}
use of org.dbflute.bhv.core.command.BatchInsertCommand in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateBatchInsert.
// -----------------------------------------------------
// Batch Update
// ------------
protected int[] delegateBatchInsert(List<? extends Entity> entityList, InsertOption<? extends ConditionBean> option) {
if (entityList.isEmpty()) {
return EMPTY_INT_ARRAY;
}
final OptionalThing<InsertOption<? extends ConditionBean>> optOption = createOptionalInsertOption(option);
adjustEntityListBeforeBatchInsert(entityList, option);
if (entityList.isEmpty()) {
// might be filtered
return EMPTY_INT_ARRAY;
}
final BatchInsertCommand command = createBatchInsertCommand(entityList, option);
RuntimeException cause = null;
try {
hookBeforeInsert(command, entityList, emptyOpt(), optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyInsert(command, entityList, emptyOpt(), optOption, createOptionalCause(cause));
}
}
Aggregations