Skip to content

Commit

Permalink
docs: reformat functions
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Jan 30, 2024
1 parent 0ad8b41 commit 3cab441
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 25 deletions.
37 changes: 26 additions & 11 deletions docs/en/jpql-with-kotlin-jdsl/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,26 +194,41 @@ Kotlin JDSL provides a series of functions to support built-in functions in JPA.

### String functions

| Function | DSL function |
|-----------|--------------|
| CONCAT | support |
| SUBSTRING | support |
| TRIM | support |
| LOWER | support |
| UPPER | support |
| LENGTH | support |
| LOCATE | support |
* CONCAT (concat)
* SUBSTRING (substring)
* TRIM (trim)
* LOWER (lower)
* UPPER (upper)
* LENGTH (length)
* LOCATE (locate)

```kotlin
concat(path(Book::title), literal(":"), path(Book::imageUrl))

substring(path(Book::title), 4)

trim(path(Book::title))
trim('B').from(path(Book::title))

lower(path(Book::title))

upper(path(Book::title))

length(path(Book::title))

locate("Book", path(Book::title))
```

### Arithmetic functions

Use the following functions to build arithmetic functions:

* ceiling
* abs
* ABS (abs)
* CEILING (ceiling)

```kotlin
abs(path(Book::price))

ceiling(path(Book::price))
```

Expand Down
41 changes: 27 additions & 14 deletions docs/ko/jpql-with-kotlin-jdsl/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,33 +191,46 @@ Kotlin JDSL은 JPA에서 제공하는 여러 함수들을 지원하기 위함

### String functions

| Function | DSL function |
|-----------|--------------|
| CONCAT | support |
| SUBSTRING | support |
| TRIM | support |
| LOWER | support |
| UPPER | support |
| LENGTH | support |
| LOCATE | support |
* CONCAT (concat)
* SUBSTRING (substring)
* TRIM (trim)
* LOWER (lower)
* UPPER (upper)
* LENGTH (length)
* LOCATE (locate)

```kotlin
concat(path(Book::title), literal(":"), path(Book::imageUrl))

substring(path(Book::title), 4)

trim(path(Book::title))
trim('B').from(path(Book::title))

lower(path(Book::title))

upper(path(Book::title))

length(path(Book::title))

locate("Book", path(Book::title))
```

### Arithmetic functions

산술 함수를 만들기 위해서는 다음 함수들을 사용할 수 있습니다.


* ceiling
* abs
* ABS (abs)
* CEILING (ceiling)

```kotlin
abs(path(Book::price))

ceiling(path(Book::price))
```

| Function | DSL function |
|----------|--------------|
| ABS | not yet |
| CEILING | not yet |
| EXP | not yet |
| FLOOR | not yet |
| LN | not yet |
Expand Down

0 comments on commit 3cab441

Please sign in to comment.