CB - The type of condition-bean for specification.public class UpdateOption<CB extends ConditionBean> extends Object implements WritableOption<CB>
| 修飾子とタイプ | クラスと説明 |
|---|---|
static interface |
UpdateOption.UpdateSelfSpecificationCBFactory<CB> |
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected Integer |
_batchLoggingUpdateLimit |
protected boolean |
_compatibleBatchUpdateDefaultEveryColumn |
protected boolean |
_disableCommonColumnAutoSetup |
protected boolean |
_exceptCommonColumnForcedSpecified |
protected Set<String> |
_forcedSpecifiedUpdateColumnSet |
protected boolean |
_nonQueryUpdateAllowed |
protected boolean |
_queryUpdateForcedDirectAllowed |
protected List<HpCalcSpecification<CB>> |
_selfSpecificationList |
protected Map<String,HpCalcSpecification<CB>> |
_selfSpecificationMap |
protected UniqueInfo |
_uniqueByUniqueInfo |
protected boolean |
_updateColumnModifiedPropertiesFragmentedAllowed |
protected SpecifyQuery<CB> |
_updateColumnSpecification |
protected CB |
_updateColumnSpecifiedCB |
protected StatementConfig |
_updateStatementConfig |
| コンストラクタと説明 |
|---|
UpdateOption()
Constructor.
|
protected List<HpCalcSpecification<CB extends ConditionBean>> _selfSpecificationList
protected Map<String,HpCalcSpecification<CB extends ConditionBean>> _selfSpecificationMap
protected SpecifyQuery<CB extends ConditionBean> _updateColumnSpecification
protected CB extends ConditionBean _updateColumnSpecifiedCB
protected UniqueInfo _uniqueByUniqueInfo
protected boolean _exceptCommonColumnForcedSpecified
protected boolean _updateColumnModifiedPropertiesFragmentedAllowed
protected boolean _compatibleBatchUpdateDefaultEveryColumn
protected boolean _disableCommonColumnAutoSetup
protected boolean _nonQueryUpdateAllowed
protected boolean _queryUpdateForcedDirectAllowed
protected Integer _batchLoggingUpdateLimit
protected StatementConfig _updateStatementConfig
public UpdateOption()
Purchase purchase = new Purchase(); purchase.setPurchaseId(value); // required purchase.setOther...(value); // you should set only modified columns // e.g. you can update by self calculation values UpdateOption<PurchaseCB> option = new UpdateOption<PurchaseCB>(); option.self(new SpecifyQuery<PurchaseCB>() { public void specify(PurchaseCB cb) { cb.specify().columnPurchaseCount(); } }).plus(1); // PURCHASE_COUNT = PURCHASE_COUNT + 1 // e.g. you can update by your values for common columns option.disableCommonColumnAutoSetup(); purchaseBhv.varyingUpdate(purchase, option);
public ColumnCalculator self(SpecifyQuery<CB> colCBLambda)
Purchase purchase = new Purchase(); purchase.setPurchaseId(value); // required purchase.setOther...(value); // you should set only modified columns UpdateOption<PurchaseCB> option = new UpdateOption<PurchaseCB>(); option.self(new SpecifyQuery<PurchaseCB>() { public void specify(PurchaseCB cb) { cb.specify().columnPurchaseCount(); } }).plus(1); // PURCHASE_COUNT = PURCHASE_COUNT + 1 purchaseBhv.varyingUpdateNonstrict(purchase, option);
colCBLambda - The callback for query for specification that specifies only one column. (NotNull)protected HpCalcSpecification<CB> createCalcSpecification(SpecifyQuery<CB> colCBLambda)
protected HpCalcSpecification<CB> newCalcSpecification(SpecifyQuery<CB> colCBLambda)
public boolean hasSelfSpecification()
public void resolveSelfSpecification(UpdateOption.UpdateSelfSpecificationCBFactory<CB> factory)
protected void throwVaryingUpdateInvalidColumnSpecificationException(CB cb)
protected void throwVaryingUpdatePrimaryKeySpecificationException(ColumnInfo columnInfo)
protected void throwVaryingUpdateCommonColumnSpecificationException(ColumnInfo columnInfo)
protected void throwVaryingUpdateOptimisticLockSpecificationException(ColumnInfo columnInfo)
public boolean hasStatement(String columnDbName)
protected HpCalcSpecification<CB> findStatementSpecification(String columnDbName)
protected void throwVaryingUpdateSpecifyCalculatonUnsupportedException(String columnDbName)
protected void throwVaryingUpdateNotFoundCalculationException(String columnDbName)
public void specify(SpecifyQuery<CB> colCBLambda)
Member member = new Member(); member.setMemberId(3); member.setOthers...(value); UpdateOption<MemberCB> option = new UpdateOption<MemberCB>(); option.specify(new SpecifyQuery<MemberCB>() { public void query(MemberCB cb) { // only MemberName and Birthdate are updated // with common columns for update and an exclusive control column cb.specify().columnMemberName(); cb.specify().columnBirthdate(); } }); memberBhv.varyingUpdate(member, option);
colCBLambda - The callback for query of specifying update columns. (NotNull)public void resolveUpdateColumnSpecification(CB cb)
public UpdateOption<CB> exceptCommonColumnForcedSpecified()
protected void xacceptCommonColumnForcedSpecification(CB cb)
protected void addForcedSpecifiedUpdateColumn(ColumnInfo columnInfo)
public void xacceptUpdateColumnModifiedPropertiesIfNeeds(List<? extends Entity> entityList)
public void xallowUpdateColumnModifiedPropertiesFragmented()
public void xdisallowUpdateColumnModifiedPropertiesFragmented()
public boolean xisUpdateColumnModifiedPropertiesFragmentedAllowed()
protected Set<String> xgatherUpdateColumnModifiedProperties(List<? extends Entity> entityList, Entity firstEntity)
protected void throwBatchUpdateColumnModifiedPropertiesFragmentedException(Set<String> baseProps, Entity entity)
public void xtoBeCompatibleBatchUpdateDefaultEveryColumn()
public boolean xisCompatibleBatchUpdateDefaultEveryColumn()
public void xcheckSpecifiedUpdateColumnPrimaryKey()
public boolean hasSpecifiedUpdateColumn()
public CB getUpdateColumnSpecifiedCB()
public boolean isSpecifiedUpdateColumn(String columnDbName)
protected void assertUpdateColumnSpecifiedCB()
public void uniqueBy(UniqueInfo uniqueInfo)
uniqueInfo - The unique info of DB meta for natural unique. (NotNull, NotPrimary)public boolean hasUniqueByUniqueInfo()
public UniqueInfo getUniqueByUniqueInfo()
public UpdateOption<CB> disableCommonColumnAutoSetup()
Member member = new Member();
member.setMemberId(3);
member.setOthers...(value);
member.setUpdateDatetime(updateDatetime);
member.setUpdateUser(updateUser);
UpdateOption<MemberCB> option = new UpdateOption<MemberCB>();
option.disableCommonColumnAutoSetup();
memberBhv.varyingUpdate(member, option);
public boolean isCommonColumnAutoSetupDisabled()
public UpdateOption<CB> allowNonQueryUpdate()
public boolean isNonQueryUpdateAllowed()
public UpdateOption<CB> allowQueryUpdateForcedDirect()
public boolean isQueryUpdateForcedDirectAllowed()
public void limitBatchUpdateLogging(Integer batchLoggingUpdateLimit)
batchLoggingUpdateLimit - The limit size of batch-update logging. (NullAllowed: if null and minus, means no limit)public Integer getBatchUpdateLoggingLimit()
public void configure(StatementConfigCall<StatementConfig> confLambda)
memberBhv.varyingUpdate(member, op -> op.configure(conf -> conf.queryTimeout(3)));
confLambda - The callback for configuration of statement for update. (NotNull)protected void assertStatementConfigNotDuplicated(StatementConfigCall<StatementConfig> configCall)
protected StatementConfig createStatementConfig(StatementConfigCall<StatementConfig> configCall)
protected StatementConfig newStatementConfig()
public StatementConfig getUpdateStatementConfig()
Copyright © 2014–2015 The DBFlute Project. All rights reserved.