Module litebridge.orm
Package org.litebridge.orm.api.merge
Class MergeWhenMatchedStep<DTO,MUS extends MergeUpdateStep,MIS extends MergeInsertStep>
java.lang.Object
org.litebridge.orm.api.merge.MergeTerminal
org.litebridge.orm.api.merge.MergeWhenNotMatchedStep<MIS>
org.litebridge.orm.api.merge.MergeWhenMatchedStep<DTO,MUS,MIS>
- Type Parameters:
DTO- the type of the DTOMUS- operation mode-specificWHEN MATCHEDupdate stepMIS- operation mode-specificWHEN NOT MATCHEDinsert step
- Direct Known Subclasses:
MergeOnConditionClauseTerminal
public sealed class MergeWhenMatchedStep<DTO,MUS extends MergeUpdateStep,MIS extends MergeInsertStep>
extends MergeWhenNotMatchedStep<MIS>
permits MergeOnConditionClauseTerminal<DTO,SELF,MUS,MIS,QCB>
Merge step for setting up
WHEN MATCHED and/or WHEN NOT MATCHED clauses.-
Field Summary
Fields inherited from class org.litebridge.orm.api.merge.MergeWhenNotMatchedStep
litebridgeContext, mergeNodeFields inherited from class org.litebridge.orm.api.merge.MergeTerminal
node -
Constructor Summary
ConstructorsConstructorDescriptionMergeWhenMatchedStep(MergeNode mergeNode, QueryNode node, LitebridgeContext litebridgeContext) Creates a newMergeWhenMatchedStepinstance. -
Method Summary
Modifier and TypeMethodDescriptionwhenMatched(Function<MUS, MergeTerminal> update) Creates aWHEN MATCHEDclause.Methods inherited from class org.litebridge.orm.api.merge.MergeWhenNotMatchedStep
whenNotMatched
-
Constructor Details
-
MergeWhenMatchedStep
public MergeWhenMatchedStep(MergeNode mergeNode, QueryNode node, LitebridgeContext litebridgeContext) Creates a newMergeWhenMatchedStepinstance.- Parameters:
mergeNode- root merge nodenode- current query nodelitebridgeContext- Litebridge context
-
-
Method Details
-
whenMatched
Creates aWHEN MATCHEDclause.A
WHEN MATCHED ANDconditional clause can be added by including aWHEREclause in the specified update function.The update function defines the
WHEN MATCHED THENbehaviour to take when a match occurs in theMERGEoperation. This method allows specifying the action to perform, typically an update or delete, through a provided function that operates on aMergeUpdateStep. AnyWHEREconditions added to theMergeUpdateStepwill be applied as part of theWHEN MATCHED ANDclause.- Parameters:
update- aFunctionthat accepts aMergeUpdateStepand produces aMergeTerminal. The function is used to define the specific update or delete operation to be executed for matched rows.- Returns:
- this instance of
MergeWhenMatchedStepfor further chaining of merge match clauses.
-