Skip to content

Commit b58526d

Browse files
Describe usage of concat (#2131)
1 parent f15a844 commit b58526d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

java/working-with-cql/query-api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,10 @@ Scalar functions are values that are calculated from other values. This calculat
14091409
.where(e -> e.get("name").substring(2).eq("ter"));
14101410
```
14111411

1412+
* Concat
1413+
1414+
See [`Concat`](#string-expressions) String Expression
1415+
14121416
#### Case-When-Then Expressions
14131417

14141418
Use a case expression to compute a value based on the evaluation of conditions. The following query converts the stock of Books into a textual representation as 'stockLevel':
@@ -1420,6 +1424,17 @@ Select.from(BOOKS).columns(
14201424
.when(b.stock().gt(100)).then("high")
14211425
.orElse("medium").as("stockLevel").type(CdsBaseType.STRING));
14221426
```
1427+
#### String Expressions
1428+
1429+
* Concat
1430+
1431+
Function `concat` creates a string expression to concatenate a specified value to this value.
1432+
1433+
```java
1434+
// SELECT from Author {name || ' - the Author' as author_name : String}
1435+
Select.from(AUTHOR)
1436+
.columns(a -> a.name().concat(" - the Author").as("author_name"));
1437+
```
14231438

14241439
#### Arithmetic Expressions
14251440

0 commit comments

Comments
 (0)