Package com.exasol.sql.dml.merge
Class MatchedClause
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.dml.merge.MatchedClause
-
- All Implemented Interfaces:
MergeFragment,Fragment
public class MatchedClause extends AbstractFragment implements MergeFragment
Representation of theWHEN MATCHEDpart of an SQLMERGE statement.This class supports two different strategies, updating matching rows or deleting matching rows.
-
-
Field Summary
-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Constructor Description MatchedClause(Fragment root)Create a new instance of aMatchedClause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(MergeVisitor visitor)Accept a visitor (e.g.MergeDeleteClausegetDelete()Get theTHEN DELETEclause.MergeUpdateClausegetUpdate()Get theTHEN UPDATEclause.booleanhasDelete()Check if theTHEN DELETEclause is present.booleanhasUpdate()Check if theTHEN UPDATEclause is present.MergeDeleteClausethenDelete()Select deleting as merge strategy for rows where that are considered matches between source and destination.MergeUpdateClausethenUpdate()Select updating as merge strategy for rows where that are considered matches between source and destination.-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Constructor Detail
-
MatchedClause
public MatchedClause(Fragment root)
Create a new instance of aMatchedClause.- Parameters:
root- root SQL statement thisWHEN MATCHEDclause belongs to
-
-
Method Detail
-
thenUpdate
public MergeUpdateClause thenUpdate()
Select updating as merge strategy for rows where that are considered matches between source and destination.- Returns:
- update clause
-
hasUpdate
public boolean hasUpdate()
Check if theTHEN UPDATEclause is present.- Returns:
trueif the update clause is present
-
getUpdate
public MergeUpdateClause getUpdate()
Get theTHEN UPDATEclause.- Returns:
THEN UPDATEclause
-
thenDelete
public MergeDeleteClause thenDelete()
Select deleting as merge strategy for rows where that are considered matches between source and destination.- Returns:
- delete clause
-
hasDelete
public boolean hasDelete()
Check if theTHEN DELETEclause is present.- Returns:
trueif the delete clause is present.
-
getDelete
public MergeDeleteClause getDelete()
Get theTHEN DELETEclause.- Returns:
THEN DELETEclause
-
accept
public void accept(MergeVisitor visitor)
Description copied from interface:MergeFragmentAccept a visitor (e.g. a renderer or validator).- Specified by:
acceptin interfaceMergeFragment- Parameters:
visitor- visitor to accept
-
-