use of org.dbflute.bhv.core.command.InsertEntityCommand in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateInsert.
// ===================================================================================
// Delegate to Command
// ===================
// -----------------------------------------------------
// Entity Update
// -------------
protected int delegateInsert(Entity entity, InsertOption<? extends ConditionBean> option) {
final OptionalThing<InsertOption<? extends ConditionBean>> optOption = createOptionalInsertOption(option);
adjustEntityBeforeInsert(entity, optOption);
final InsertEntityCommand command = createInsertEntityCommand(entity, option);
RuntimeException cause = null;
try {
hookBeforeInsert(command, entity, emptyOpt(), optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyInsert(command, entity, emptyOpt(), optOption, createOptionalCause(cause));
}
}
use of org.dbflute.bhv.core.command.InsertEntityCommand in project dbflute-core by dbflute.
the class AbstractBehaviorReadable method createInsertEntityCommand.
// -----------------------------------------------------
// Write
// -----
// defined here (on the readable interface) for non-primary key value
protected InsertEntityCommand createInsertEntityCommand(Entity entity, InsertOption<? extends ConditionBean> option) {
assertBehaviorCommandInvoker("createInsertEntityCommand");
final InsertEntityCommand cmd = newInsertEntityCommand();
xsetupEntityCommand(cmd, entity);
cmd.setInsertOption(option);
return cmd;
}
Aggregations