public class Merge extends AbstractFragment implements SqlStatement, MergeFragment
root| Constructor and Description |
|---|
Merge(String destinationTable)
Create a new instance of a
Merge. |
Merge(String destinationTable,
String alias)
Create a new instance of a
Merge. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(MergeVisitor visitor)
Accept a visitor (e.g.
|
MatchedClause |
getMatched()
Get the
WHEN MATCHED clause. |
MatchedClause |
getNotMatched()
Get the
WHEN NOT MATCHED clause. |
OnClause |
getOn()
Get the merge criteria (i.e.
|
UsingClause |
getUsing()
Get the
USING clause of the MERGE statement. |
protected boolean |
hasMatched()
Check if the
WHEN MATCHED clause exists. |
protected boolean |
hasNotMatched()
Check if the
WHEN NOT MATCHED clause exists. |
protected boolean |
hasOn()
Check if the
ON clause exists. |
protected boolean |
hasUsing()
Check if the
USING clause exists. |
Merge |
on(BooleanExpression condition)
Define the merge criteria.
|
Merge |
using(String sourceTable)
Define the data source.
|
Merge |
using(String sourceTable,
String as)
Define the data source.
|
MatchedClause |
whenMatched()
Define the merge strategy if the match criteria is met.
|
NotMatchedClause |
whenNotMatched()
Define the merge strategy if the match criteria is not met.
|
getRootpublic Merge(String destinationTable)
Merge.destinationTable - table into which the data should be mergedpublic Merge using(String sourceTable)
sourceTable - table where the data to be merged originatesthis for fluent programmingpublic Merge using(String sourceTable, String as)
sourceTable - table where the data to be merged originatesas - table aliasthis for fluent programmingpublic UsingClause getUsing()
USING clause of the MERGE statement.protected boolean hasUsing()
USING clause exists.true if the USING clause exists.public Merge on(BooleanExpression condition)
condition - criteria that must be met for the rows in source and destination to be considered a match.this for fluent programmingpublic OnClause getOn()
protected boolean hasOn()
ON clause exists.true if the ON clause exists.public MatchedClause whenMatched()
protected boolean hasMatched()
WHEN MATCHED clause exists.true if the WHEN MATCHED clause existspublic MatchedClause getMatched()
WHEN MATCHED clause.WHEN MATCHED clausepublic NotMatchedClause whenNotMatched()
protected boolean hasNotMatched()
WHEN NOT MATCHED clause exists.WHEN NOT MATCHED clause existspublic MatchedClause getNotMatched()
WHEN NOT MATCHED clause.WHEN NOT MATCHED clausepublic void accept(MergeVisitor visitor)
MergeFragmentaccept in interface MergeFragmentvisitor - visitor to acceptCopyright © 2018–2021. All rights reserved.