use of org.dbflute.cbean.ConditionBean 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.cbean.ConditionBean in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method delegateUpdateNonstrict.
protected int delegateUpdateNonstrict(Entity entity, UpdateOption<? extends ConditionBean> option) {
final OptionalThing<UpdateOption<? extends ConditionBean>> optOption = createOptionalUpdateOption(option);
adjustEntityBeforeUpdate(entity, optOption);
final UpdateNonstrictEntityCommand command = createUpdateNonstrictEntityCommand(entity, option);
RuntimeException cause = null;
try {
hookBeforeUpdate(command, entity, emptyOpt(), optOption);
return invoke(command);
} catch (RuntimeException e) {
cause = e;
throw e;
} finally {
hookFinallyUpdate(command, entity, emptyOpt(), optOption, createOptionalCause(cause));
}
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method setupCommonColumnOfInsertIfNeeds.
/**
* Set up common columns of insert if it needs.
* @param entity The entity for insert. (NotNull)
* @param option The optional option of insert. (NotNull, EmptyAllowed: when no option)
*/
protected void setupCommonColumnOfInsertIfNeeds(Entity entity, OptionalThing<InsertOption<? extends ConditionBean>> option) {
if (option.filter(op -> op.isCommonColumnAutoSetupDisabled()).isPresent()) {
return;
}
final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper();
assertCommonColumnAutoSetupperNotNull();
setupper.handleCommonColumnOfInsertIfNeeds(entity);
}
use of org.dbflute.cbean.ConditionBean in project dbflute-core by dbflute.
the class AbstractBehaviorWritable method setupCommonColumnOfUpdateIfNeeds.
/**
* Set up common columns of update if it needs.
* @param entity The entity for update. (NotNull)
* @param option The optional option of update. (NotNull, EmptyAllowed: when no option)
*/
protected void setupCommonColumnOfUpdateIfNeeds(Entity entity, OptionalThing<UpdateOption<? extends ConditionBean>> option) {
if (option.filter(op -> op.isCommonColumnAutoSetupDisabled()).isPresent()) {
return;
}
final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper();
assertCommonColumnAutoSetupperNotNull();
setupper.handleCommonColumnOfUpdateIfNeeds(entity);
}
use of org.dbflute.cbean.ConditionBean 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