Module litebridge.orm
Package org.litebridge.orm.api.merge
Class MergeOnStep<DTO,MCCT extends MergeOnConditionClauseTerminal<DTO,MCCT,MUS,MIS,QCB>,MUS extends MergeUpdateStep,MIS extends MergeInsertStep,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>
java.lang.Object
org.litebridge.orm.api.merge.MergeOnStep<DTO,MCCT,MUS,MIS,QCB>
- Type Parameters:
DTO- the type of the DTOMUS- operation mode-specificWHEN MATCHEDupdate stepMIS- operation mode-specificWHEN NOT MATCHEDinsert step
- Direct Known Subclasses:
DtoMergeOnStep,SqlMergeOnStep
public abstract sealed class MergeOnStep<DTO,MCCT extends MergeOnConditionClauseTerminal<DTO,MCCT,MUS,MIS,QCB>,MUS extends MergeUpdateStep,MIS extends MergeInsertStep,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>
extends Object
permits DtoMergeOnStep<DTO>, SqlMergeOnStep
Merge step for setting up the
MERGE INTO ... USING ... ON condition.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LitebridgeContextThe Litebridge context.protected final MergeNodeThe root merge node containing target table informationprotected final @Nullable Stringprotected final @Nullable Class<?> The using DTO class in DTO mode.protected final @Nullable QueryNodeThe using sub-query's terminal nodeprotected final @Nullable StringThe using table name in SQL mode.protected final @Nullable ValuesSpecUsing VALUES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMergeOnStep(Class<?> usingDtoClass, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance for DTO mode.MergeOnStep(String usingTable, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance for SQL mode.MergeOnStep(QueryNode subselectNode, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance.protectedMergeOnStep(ValuesSpec valuesSpec, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract MCCTcreateMergeOnConditionClauseTerminal(QueryNode conditionNode, @Nullable String alias) Creates aMERGE INTO ... USING ... ONcondition targeting the specified column.on(ExpressionSpec expression) Creates aMERGE INTO ... USING ... ONcondition using an expression.abstract MCCTCreates aMERGE INTO ... USING ... ONcondition using a nested condition block.protected String
-
Field Details
-
usingAlias
-
mergeNode
The root merge node containing target table information -
usingTable
The using table name in SQL mode. -
usingDtoClass
The using DTO class in DTO mode. -
usingQueryNode
The using sub-query's terminal node -
usingValues
Using VALUES -
litebridgeContext
The Litebridge context.
-
-
Constructor Details
-
MergeOnStep
public MergeOnStep(String usingTable, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance for SQL mode.- Parameters:
usingTable- the merge using tablemergeNode- the root merge nodelitebridgeContext- Litebridge context
-
MergeOnStep
public MergeOnStep(QueryNode subselectNode, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance.- Parameters:
subselectNode- Subquery to merge on.mergeNode- the root merge nodelitebridgeContext- the Litebridge context
-
MergeOnStep
protected MergeOnStep(Class<?> usingDtoClass, @Nullable String usingAlias, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance for DTO mode.- Parameters:
usingDtoClass- the using DTO classmergeNode- the root merge nodelitebridgeContext- the Litebridge context
-
MergeOnStep
protected MergeOnStep(ValuesSpec valuesSpec, MergeNode mergeNode, LitebridgeContext litebridgeContext) Creates a newMergeOnStepinstance.- Parameters:
valuesSpec- Values from target specificationmergeNode- the root merge nodelitebridgeContext- the Litebridge context
-
-
Method Details
-
on
Creates aMERGE INTO ... USING ... ONcondition targeting the specified column.- Parameters:
column- the LHS column of theONcondition- Returns:
- the next step in the update operation: setting the value of the target column
-
on
Creates aMERGE INTO ... USING ... ONcondition using an expression.- Parameters:
expression- expression specifying the target LHS column of theONcondition- Returns:
- the next step in the update operation: setting the value of the target column
-
on
Creates aMERGE INTO ... USING ... ONcondition using a nested condition block.- Parameters:
query- the query condition builder- Returns:
- the condition clause terminal
-
createMergeOnConditionClauseTerminal
-
usingTable
-