Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MERGE support for HQL/Criteria #5896

beikov started this conversation in Design Proposals
Discussion options

Support the SQL standard MERGE statement. Essentially it's like INSERT with the CONFLICT clause, but also offers the possibility to do DELETEs/UPDATEs. Quite a few DBMS support this. The concurrency guarantees of the statement AFAIU allows such a statement to be implemented by executing the individual parts as separate statements, so emulation should be possible.

Also see:

Syntax-wise I would suggest we follow the SQL standard approach which seems sane to me.

merge_statement : MERGE INTO entityName (AS identifier)? USING fromRoot ON predicate merge_when_clause+;
merge_when_clause
 : WHEN MATCHED (AND predicate)? THEN (UPDATE setClause | DELETE)
 | WHEN NOT MATCHED (AND predicate)? THEN insertStatement
 ;
You must be logged in to vote

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /