Skip to content

Commit

Permalink
Add || string concatenation operator (#418)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <[email protected]>
Co-authored-by: Lukas Jungmann <[email protected]>
  • Loading branch information
gavinking and lukasj authored Jul 11, 2023
1 parent 47a7548 commit 1d69902
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion spec/src/main/asciidoc/appendixes.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017, 2022 Contributors to the Eclipse Foundation
// Copyright (c) 2017, 2023 Contributors to the Eclipse Foundation
//

[appendix]
Expand Down Expand Up @@ -101,3 +101,7 @@ Clarified definition of the _Basic_ type
Clarified the order of parameters in the _LOCATE_ function

Clarified `SqlResultSetMapping` with multiple ``EntityResult``s and conflicting aliases

=== Jakarta Persistence 3.2

Added `||` string concatenation operator
13 changes: 10 additions & 3 deletions spec/src/main/asciidoc/ch04-query-language.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017, 2022 Contributors to the Eclipse Foundation
// Copyright (c) 2017, 2023 Contributors to the Eclipse Foundation
//

== Query Language [[a4665]]
Expand Down Expand Up @@ -1209,6 +1209,7 @@ The operators are listed below in order of decreasing precedence.
** +, - unary
** *, / multiplication and division
** +, - addition and subtraction
* String concatenation (_||_)
* Comparison operators: _=_, _>_, _>=_, _<_
, _<=_, _<>_ (not equal), _[NOT]_ _BETWEEN_, _[NOT]_ _LIKE_, _[NOT]_
_IN_, _IS_ _[NOT]_ _NULL_, _IS_ _[NOT]_ _EMPTY_, _[NOT]_ _MEMBER_
Expand Down Expand Up @@ -1655,6 +1656,11 @@ Arithmetic operations use numeric promotion.

Arithmetic functions are described in <<a5284>>.

===== String concatenation operator

The binary concatenation operator is ||.
Its operands must be string expressions.

===== Built-in String, Arithmetic, and Datetime Functional Expressions

The Jakarta Persistence query language includes
Expand Down Expand Up @@ -2741,8 +2747,8 @@ non-like type values are disallowed except for this numeric case.

[NOTE]
====
Note that the arithmetic operators and
comparison operators are permitted to be applied to state fields and
Note that the arithmetic operators, the string concatenation operator,
and comparison operators are permitted to be applied to state fields and
input parameters of the wrapped Java class equivalents to the primitive
numeric Java types.
====
Expand Down Expand Up @@ -3084,6 +3090,7 @@ string_expression ::=
aggregate_expression |
case_expression |
function_invocation |
string_expression || string_expression
(subquery)
datetime_expression ::=
state_valued_path_expression |
Expand Down

1 comment on commit 1d69902

@edburns
Copy link

@edburns edburns commented on 1d69902 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see another longtimer back in the community work streams, @gavinking .

Please sign in to comment.